Re: [PATCH] arm64/cpufeature: Move BUG_ON() inside get_arm64_ftr_reg()

2020-05-20 Thread Anshuman Khandual
On 05/20/2020 05:50 PM, Will Deacon wrote: > Hi Anshuman, > > On Wed, May 20, 2020 at 06:52:54AM +0530, Anshuman Khandual wrote: >> There is no way to proceed when requested register could not be searched in >> arm64_ftr_reg[]. Requesting for a non present register would b

Re: [PATCH] arm64/cpufeature: Move BUG_ON() inside get_arm64_ftr_reg()

2020-05-20 Thread Anshuman Khandual
On 05/20/2020 11:09 PM, Will Deacon wrote: > On Wed, May 20, 2020 at 04:47:11PM +0100, Catalin Marinas wrote: >> On Wed, May 20, 2020 at 01:20:13PM +0100, Will Deacon wrote: >>> On Wed, May 20, 2020 at 06:52:54AM +0530, Anshuman Khandual wrote: >>>> There is no

Re: [RFC V2] mm/vmstat: Add events for PMD based THP migration without split

2020-05-20 Thread Anshuman Khandual
On 05/20/2020 12:45 PM, HORIGUCHI NAOYA(堀口 直也) wrote: > On Mon, May 18, 2020 at 12:12:36PM +0530, Anshuman Khandual wrote: >> This adds the following two new VM events which will help in validating PMD >> based THP migration without split. Statistics reported through these even

Re: [PATCH mmotm] mm/vmstat: Add events for PMD based THP migration without split fix

2020-05-21 Thread Anshuman Khandual
On 05/21/2020 07:19 PM, Hugh Dickins wrote: > Fix 5.7-rc6-mm1 page migration crash in unmap_and_move(): when the > page to be migrated has been freed from under us, that is considered > a MIGRATEPAGE_SUCCESS, but no newpage has been allocated (and I don't > think it would ever need to be counte

Re: [RFC/RFT PATCH 1/6] numa: Move numa implementation to common code

2020-08-19 Thread Anshuman Khandual
On 08/20/2020 12:48 AM, Atish Patra wrote: > On Tue, Aug 18, 2020 at 8:19 PM Anshuman Khandual > wrote: >> >> >> >> On 08/15/2020 03:17 AM, Atish Patra wrote: >>> ARM64 numa implementation is generic enough that RISC-V can reuse that >>> imple

[PATCH] mm/hotplug: Enumerate memory range offlining failure reasons

2020-08-17 Thread Anshuman Khandual
: Dan Williams Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This is based on 5.9-rc1 include/linux/memory.h | 28 mm/memory_hotplug.c| 18 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff

Re: [PATCH] mm/hotplug: Enumerate memory range offlining failure reasons

2020-08-17 Thread Anshuman Khandual
On 08/18/2020 11:35 AM, Michal Hocko wrote: > On Tue 18-08-20 09:52:02, Anshuman Khandual wrote: >> Currently a debug message is printed describing the reason for memory range >> offline failure. This just enumerates existing reason codes which improves >> overall rea

Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-08-18 Thread Anshuman Khandual
On 08/18/2020 02:43 PM, Jonathan Cameron wrote: > On Mon, 17 Aug 2020 14:49:43 +0530 > Anshuman Khandual wrote: > >> pmd_present() and pmd_trans_huge() are expected to behave in the following >> manner during various phases of a given PMD. It is derived from a previous &

Re: [RFC/RFT PATCH 1/6] numa: Move numa implementation to common code

2020-08-18 Thread Anshuman Khandual
On 08/15/2020 03:17 AM, Atish Patra wrote: > ARM64 numa implementation is generic enough that RISC-V can reuse that > implementation with very minor cosmetic changes. This will help both > ARM64 and RISC-V in terms of maintanace and feature improvement > > Move the numa implementation code to c

Re: [PATCH v2 1/2] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags

2020-08-19 Thread Anshuman Khandual
On 08/19/2020 11:17 AM, Alex Shi wrote: > pageblock_flags is used as long, since every pageblock_flags is just 4 > bits, 'long' size will include 8(32bit machine) or 16 pageblocks' flags, > that flag setting has to sync in cmpxchg with 7 or 15 other pageblock > flags. It would cause long waiting

Re: [PATCH v2 2/2] mm/pageblock: remove false sharing in pageblock_flags

2020-08-19 Thread Anshuman Khandual
On 08/19/2020 11:17 AM, Alex Shi wrote: > Current pageblock_flags is only 4 bits, so it has to share a char size > in cmpxchg when get set, the false sharing cause perf drop. > > If we incrase the bits up to 8, false sharing would gone in cmpxchg. and > the only cost is half char per pageblock,

Re: [PATCH] mm: Fix missing function declaration

2020-08-19 Thread Anshuman Khandual
27; > [-Wmissing-prototypes] > 15 | void rodata_test(void) > | ^~~ > > Fixes: 2959a5f726f6 ("mm: add arch-independent testcases for RODATA") > Signed-off-by: Leon Romanovsky This build failure appears only with W=1 and gets fixed with this. Review

Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-08-19 Thread Anshuman Khandual
On 08/18/2020 05:56 PM, Jonathan Cameron wrote: > On Tue, 18 Aug 2020 15:11:58 +0530 > Anshuman Khandual wrote: > >> On 08/18/2020 02:43 PM, Jonathan Cameron wrote: >>> On Mon, 17 Aug 2020 14:49:43 +0530 >>> Anshuman Khandual wrote: >>> >>&g

Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug

2021-01-10 Thread Anshuman Khandual
On 1/8/21 9:00 PM, David Hildenbrand wrote: >> To summarize, the section size bits for each base page size config >> should always >> >> a. Avoid (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS > > Pageblocks must also always fall completely into a section. > >> >> b. Provide minimum possible

Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug

2021-01-11 Thread Anshuman Khandual
On 1/11/21 3:43 PM, David Hildenbrand wrote: > On 11.01.21 05:17, Anshuman Khandual wrote: >> >> >> On 1/8/21 9:00 PM, David Hildenbrand wrote: >>>> To summarize, the section size bits for each base page size config >>>> should always &

Re: [PATCH 1/1] arm64: reduce section size for sparsemem

2021-01-11 Thread Anshuman Khandual
-off-by: Sudarshan Rajagopalan > Suggested-by: David Hildenbrand > Cc: Will Deacon > Cc: Anshuman Khandual > Cc: Mike Rapoport > Cc: Mark Rutland > Cc: Suren Baghdasaryan A nit. Please add all relevant mailing lists like LAKML, MM along with other developers here in the CC l

Re: [PATCH V2 1/3] mm/hotplug: Prevalidate the address range being added with platform

2021-01-11 Thread Anshuman Khandual
On 1/11/21 4:21 PM, David Hildenbrand wrote: > On 17.12.20 16:28, Anshuman Khandual wrote: >> This introduces memhp_range_allowed() which can be called in various memory >> hotplug paths to prevalidate the address range which is being added, with >> the platform. The

Re: [PATCH V2 1/3] mm/hotplug: Prevalidate the address range being added with platform

2021-01-11 Thread Anshuman Khandual
On 1/11/21 7:13 PM, Oscar Salvador wrote: > On Mon, Jan 11, 2021 at 11:51:47AM +0100, David Hildenbrand wrote: >> AFAIKs, all memhp_get_pluggable_range() users pass "1". >> >> What about the "add_pages()-only" path? > > I guess you refer to memremap_pages(), right? Right, via pagemap_range().

Re: [PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug

2021-01-11 Thread Anshuman Khandual
> Cc: Oscar Salvador > Cc: Wei Yang > Cc: Andrew Morton > Cc: catalin.mari...@arm.com > Cc: teawater > Cc: Anshuman Khandual > Cc: Pankaj Gupta > Cc: Jonathan Cameron > Cc: h...@linux.ibm.com > Cc: Vasily Gorbik > Cc: Will Deacon > Cc: Ard Biesheuv

[RFC 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVIE based memory

2020-12-21 Thread Anshuman Khandual
Biesheuvel Cc: Mark Rutland Cc: James Morse Cc: Robin Murphy Cc: Jérôme Glisse Cc: Dan Williams Cc: David Hildenbrand Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory arm64/mm

[RFC 2/2] arm64/mm: Reorganize pfn_valid()

2020-12-21 Thread Anshuman Khandual
replace the open coded pfn <--> addr conversion with __[pfn|phys]_to_[phys|pfn](). This does not cause any functional change. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual ---

[RFC 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2020-12-21 Thread Anshuman Khandual
normal hotplug memory as well. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Robin Murphy Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Fixes: 73b20c84d42d ("arm64: mm: implement pte_devmap support") Signed-off-by: Anshuman Khandual --- arc

[PATCH 02/11] coresight: Do not scan for graph if none is present

2020-12-23 Thread Anshuman Khandual
. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-platform.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/core

[PATCH 00/11] arm64: coresight: Enable ETE and TRBE

2020-12-23 Thread Anshuman Khandual
-arm-kernel/1605012309-24812-1-git-send-email-anshuman.khand...@arm.com/ Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Linu Cherian Cc: coresi...@lists.linaro.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (5): arm64: Add TRBE definit

[PATCH 03/11] coresight: etm4x: Add support for PE OS lock

2020-12-23 Thread Anshuman Khandual
: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 50 ++ drivers/hwtracing/coresight/coresight-etm4x.h | 15 +++ 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers

[PATCH 04/11] coresight: ete: Add support for ETE sysreg access

2020-12-23 Thread Anshuman Khandual
: Mike Leach Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 32 + drivers/hwtracing/coresight/coresight-etm4x.h | 42 +- 2 files changed, 65 insertions(+), 9

[PATCH 01/11] coresight: etm-perf: Allow an event to use different sinks

2020-12-23 Thread Anshuman Khandual
, the event will only trace on the first detected sink. Cc: Mathieu Poirier Cc: Mike Leach Tested-by: Linu Cherian Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm-perf.c | 48 +++- 1 file changed, 38 insertions

[PATCH 05/11] coresight: ete: Add support for ETE tracing

2020-12-23 Thread Anshuman Khandual
indicating TraceActive. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 56 +- drivers/hwtracing/coresight/coresight-etm4x.h | 7 +++ 2 files changed, 50

[PATCH 06/11] dts: bindings: Document device tree bindings for ETE

2020-12-23 Thread Anshuman Khandual
Leach Cc: Rob Herring Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Documentation/devicetree/bindings/arm/ete.txt | 41 +++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/ete.txt diff --git a

[PATCH 09/11] coresight: etm-perf: Truncate the perf record if handle has no space

2020-12-23 Thread Anshuman Khandual
While starting off the etm event, just abort and truncate the perf record if the perf handle as no space left. This avoids configuring both source and sink devices in case the data cannot be consumed in perf. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman

[PATCH 08/11] coresight: core: Add support for dedicated percpu sinks

2020-12-23 Thread Anshuman Khandual
connections are not present for certain percpu source and sink devices which are exclusively linked and dependent. Build the path directly and skip connection scanning for such devices. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Changes in V1

[PATCH 07/11] arm64: Add TRBE definitions

2020-12-23 Thread Anshuman Khandual
This adds TRBE related registers and corresponding feature macros. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Changes in V1: - Re-arranged TRBE register definitions per existing sorted registers - Replaced some instances with BIT() and

[PATCH 10/11] coresight: sink: Add TRBE driver

2020-12-23 Thread Anshuman Khandual
is full. Overall implementation here is inspired from the Arm SPE driver. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Changes in V1: - Replaced direct alignment tests with IS_ALIGNED() - Dropped trbe_perf->pid as its not really requi

[PATCH 11/11] dts: bindings: Document device tree binding for Arm TRBE

2020-12-23 Thread Anshuman Khandual
This patch documents the device tree binding in use for Arm TRBE. Cc: devicet...@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Changes in V1: - TRBE DT entry has been renamed as 'arm, trace-buffer-extension' Doc

Re: [PATCH] arm64: mm: decrease the section size to reduce the memory reserved for the page map

2020-12-07 Thread Anshuman Khandual
On 12/7/20 3:34 PM, Mike Rapoport wrote: > On Mon, Dec 07, 2020 at 10:49:26AM +0100, Ard Biesheuvel wrote: >> On Mon, 7 Dec 2020 at 10:42, Mike Rapoport wrote: >>> >>> On Mon, Dec 07, 2020 at 09:35:06AM +, Marc Zyngier wrote: On 2020-12-07 09:09, Ard Biesheuvel wrote: > (+ Marc) >>

[PATCH 0/3] mm/hotplug: Pre-validate the address range with platform

2020-12-07 Thread Anshuman Khandual
Ard Biesheuvel Cc: Mark Rutland Cc: David Hildenbrand Cc: Andrew Morton Cc: linux-arm-ker...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (3): mm/hotplug: Prevalidate the address range being added with platform arm6

[PATCH 2/3] arm64/mm: Define arch_get_mappable_range()

2020-12-07 Thread Anshuman Khandual
() has already been called. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Mark Rutland Cc: David Hildenbrand Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 15 +++ 1 file changed, 7

[PATCH 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-07 Thread Anshuman Khandual
VM_BUG_ON() check that would ensure that memhp_range_allowed() has already been called on the hotplug path. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: David Hildenbrand Cc: linux-s...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/s390/mm/extmem.c | 5

[PATCH 1/3] mm/hotplug: Prevalidate the address range being added with platform

2020-12-07 Thread Anshuman Khandual
in the call chain. Cc: David Hildenbrand Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Suggested-by: David Hildenbrand Signed-off-by: Anshuman Khandual --- include/linux/memory_hotplug.h | 3 ++ mm/memory_hotplug.c| 78

Re: [RFC V2 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-07 Thread Anshuman Khandual
On 12/7/20 2:33 PM, David Hildenbrand wrote: > On 07.12.20 05:38, Anshuman Khandual wrote: >> >> >> On 12/3/20 5:31 PM, David Hildenbrand wrote: >>> On 03.12.20 12:51, Heiko Carstens wrote: >>>> On Thu, Dec 03, 2020 at 06:03:00AM +0530, Anshuman Khandua

[PATCH V2 00/11] arm64: coresight: Enable ETE and TRBE

2021-01-12 Thread Anshuman Khandual
lose Cc: Mike Leach Cc: Linu Cherian Cc: coresi...@lists.linaro.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (4): arm64: Add TRBE definitions coresight: core: Add support for dedicated percpu sinks coresight: etm-perf: Truncate the perf re

[PATCH V2 01/11] coresight: etm-perf: Allow an event to use different sinks

2021-01-12 Thread Anshuman Khandual
, the event will only trace on the first detected sink. Cc: Mathieu Poirier Cc: Mike Leach Tested-by: Linu Cherian Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm-perf.c | 48 +++- 1 file changed, 38 insertions

[PATCH V2 02/11] coresight: Do not scan for graph if none is present

2021-01-12 Thread Anshuman Khandual
. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-platform.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/core

[PATCH V2 04/11] coresight: ete: Add support for ETE sysreg access

2021-01-12 Thread Anshuman Khandual
: Mike Leach Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 32 + drivers/hwtracing/coresight/coresight-etm4x.h | 52 ++ 2 files changed, 75 insertions(+), 9

[PATCH V2 06/11] dts: bindings: Document device tree bindings for ETE

2021-01-12 Thread Anshuman Khandual
Leach Cc: Rob Herring Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Documentation/devicetree/bindings/arm/ete.yaml | 71 ++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/ete.yaml diff --git a

[PATCH V2 05/11] coresight: ete: Add support for ETE tracing

2021-01-12 Thread Anshuman Khandual
indicating TraceActive. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Changes in V2: - Update Kconfig title and description to include ETE - Filter out registers not implemented in ETE from sysfs drivers/hwtracing/coresight/Kconfig

[PATCH V2 03/11] coresight: etm4x: Add support for PE OS lock

2021-01-12 Thread Anshuman Khandual
: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 50 ++ drivers/hwtracing/coresight/coresight-etm4x.h | 15 +++ 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers

[PATCH V2 09/11] coresight: etm-perf: Truncate the perf record if handle has no space

2021-01-12 Thread Anshuman Khandual
While starting off the etm event, just abort and truncate the perf record if the perf handle as no space left. This avoids configuring both source and sink devices in case the data cannot be consumed in perf. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman

[PATCH V2 10/11] coresight: sink: Add TRBE driver

2021-01-12 Thread Anshuman Khandual
is full. Overall implementation here is inspired from the Arm SPE driver. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Changes in V2: - Dropped irq from coresight sysfs documentation - Renamed get_trbe_limit() as compute_trbe_buffer_limit

[PATCH V2 08/11] coresight: core: Add support for dedicated percpu sinks

2021-01-12 Thread Anshuman Khandual
connections are not present for certain percpu source and sink devices which are exclusively linked and dependent. Build the path directly and skip connection scanning for such devices. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing

[PATCH V2 07/11] arm64: Add TRBE definitions

2021-01-12 Thread Anshuman Khandual
This adds TRBE related registers and corresponding feature macros. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/sysreg.h | 49 + 1 file changed, 49 insertions(+) diff --git a/arch

[PATCH V2 11/11] dts: bindings: Document device tree bindings for Arm TRBE

2021-01-12 Thread Anshuman Khandual
From: Suzuki K Poulose Document the device tree bindings for Trace Buffer Extension (TRBE). Cc: Anshuman Khandual Cc: Mathieu Poirier Cc: Rob Herring Cc: devicet...@vger.kernel.org Signed-off-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- Documentation/devicetree/bindings/arm

Re: [PATCH V2 1/3] mm/hotplug: Prevalidate the address range being added with platform

2021-01-12 Thread Anshuman Khandual
On 1/12/21 3:39 PM, David Hildenbrand wrote: > On 12.01.21 04:51, Anshuman Khandual wrote: >> >> >> On 1/11/21 7:13 PM, Oscar Salvador wrote: >>> On Mon, Jan 11, 2021 at 11:51:47AM +0100, David Hildenbrand wrote: >>>> AFAIKs, all memhp_get_pluggable_ra

Re: [PATCH V2 3/3] s390/mm: Define arch_get_mappable_range()

2021-01-12 Thread Anshuman Khandual
On 1/11/21 4:10 PM, David Hildenbrand wrote: > On 17.12.20 16:28, Anshuman Khandual wrote: >> This overrides arch_get_mappabble_range() on s390 platform which will be >> used with recently added generic framework. It modifies the existing range >> check in vme

[PATCH V3 1/3] mm/memory_hotplug: Prevalidate the address range being added with platform

2021-01-18 Thread Anshuman Khandual
in arch_add_memory() where applicable and check_hotplug_memory_addressable(), with unified memhp_range_allowed(). Cc: David Hildenbrand Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Suggested-by: David Hildenbrand Signed-off-by: Anshuman Khandual --- include/linux

[PATCH V3 2/3] arm64/mm: Define arch_get_mappable_range()

2021-01-18 Thread Anshuman Khandual
() has already been called. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Mark Rutland Cc: David Hildenbrand Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 15 +++ 1 file changed, 7

[PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug

2021-01-18 Thread Anshuman Khandual
corner cases only some memory at the end of the device-managed memory region to not be pluggable. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Pankaj Gupta Cc: Michal Hocko Cc: Oscar Salvador Cc: Wei Yang Cc: Andrew Morton Cc: catalin.mari...@arm.com Cc: teawater Cc: Anshuman Khandual

[PATCH V3 0/3] mm/memory_hotplug: Pre-validate the address range with platform

2021-01-18 Thread Anshuman Khandual
orton Cc: linux-arm-ker...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (3): mm/memory_hotplug: Prevalidate the address range being added with platform arm64/mm: Define arch_get_mappable_range() s390/mm: Define arch_get

[PATCH V3 3/3] s390/mm: Define arch_get_mappable_range()

2021-01-18 Thread Anshuman Khandual
been called on the hotplug path. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: David Hildenbrand Cc: linux-s...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Heiko Carstens Signed-off-by: Anshuman Khandual --- arch/s390/mm/init.c | 1 + arch/s390/mm/vmem.c | 15 ++- 2

Re: [PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug

2021-01-18 Thread Anshuman Khandual
On 1/18/21 6:43 PM, Anshuman Khandual wrote: > From: David Hildenbrand > > Right now, we only check against MAX_PHYSMEM_BITS - but turns out there > are more restrictions of which memory we can actually hotplug, especially > om arm64 or s390x once we support them: we might re

Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug

2021-01-07 Thread Anshuman Khandual
On 1/7/21 6:00 PM, David Hildenbrand wrote: > On 06.01.21 07:11, Anshuman Khandual wrote: >> Hi Sudershan, >> >> This patch (and the cover letter) does not copy LAKML even though the >> entire change here is arm64 specific. Please do copy all applicable >>

Re: [PATCH] mm,hwpoison: Fix printing of page flags

2021-01-08 Thread Anshuman Khandual
On 1/8/21 2:22 PM, Oscar Salvador wrote: > Format %pG expects a lower case 'p' in order to print the flags. > Fix it. > > Reported-by: Dan Carpenter > Signed-off-by: Oscar Salvador > Fixes: 8295d535e2aa ("mm,hwpoison: refactor get_any_page") Review

Re: [PATCH V2 07/11] arm64: Add TRBE definitions

2021-01-14 Thread Anshuman Khandual
On 1/13/21 2:51 PM, Suzuki K Poulose wrote: > On 1/13/21 4:18 AM, Anshuman Khandual wrote: >> This adds TRBE related registers and corresponding feature macros. >> >> Cc: Mathieu Poirier >> Cc: Mike Leach >> Cc: Suzuki K Poulose >> Signed-off-by: An

Re: [PATCH V2 08/11] coresight: core: Add support for dedicated percpu sinks

2021-01-14 Thread Anshuman Khandual
On 1/13/21 3:13 PM, Suzuki K Poulose wrote: > On 1/13/21 4:18 AM, Anshuman Khandual wrote: >> Add support for dedicated sinks that are bound to individual CPUs. (e.g, >> TRBE). To allow quicker access to the sink for a given CPU bound source, >> keep a percpu array of t

Re: [PATCH V2 10/11] coresight: sink: Add TRBE driver

2021-01-14 Thread Anshuman Khandual
On 1/13/21 8:58 PM, Suzuki K Poulose wrote: > Hi Anshuman, > > The driver looks overall good to me. Please find some minor comments below > > On 1/13/21 4:18 AM, Anshuman Khandual wrote: >> Trace Buffer Extension (TRBE) implements a trace buffer per CPU which is >>

[PATCH V3] mm: Generalize HUGETLB_PAGE_SIZE_VARIABLE

2021-03-04 Thread Anshuman Khandual
: linuxppc-...@lists.ozlabs.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Suggested-by: Christoph Hellwig Signed-off-by: Anshuman Khandual --- This change was originally suggested in an earilier discussion. This applies on v5.12-rc1 and has been build tested on all applicable platforms i.e

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread Anshuman Khandual
On 3/4/21 3:06 PM, Will Deacon wrote: > On Thu, Mar 04, 2021 at 09:12:31AM +0100, David Hildenbrand wrote: >> On 04.03.21 04:31, Anshuman Khandual wrote: >>> On 3/4/21 2:54 AM, Will Deacon wrote: >>>> On Wed, Mar 03, 2021 at 07:04:33PM +, Catalin Marinas wrote:

[PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread Anshuman Khandual
-4001-1-git-send-email-anshuman.khand...@arm.com/ Anshuman Khandual (2): arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory arm64/mm: Reorganize pfn_valid() arch/arm64/mm/init.c | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) -- 2.20.1

[PATCH V3 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread Anshuman Khandual
normal hotplug memory as well. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Robin Murphy Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: David Hildenbrand Fixes: 73b20c84d42d ("arm64: mm: implement pte_devmap support") Signed-off-by

[PATCH V3 2/2] arm64/mm: Reorganize pfn_valid()

2021-03-04 Thread Anshuman Khandual
. This does not cause any functional change. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: David Hildenbrand Signed-off-by: Anshuman Khandual --- arch/arm64/mm/init.c | 21 - 1 file

Re: [PATCH V3 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread Anshuman Khandual
On 3/5/21 10:54 AM, Anshuman Khandual wrote: > This series fixes pfn_valid() for ZONE_DEVICE based memory and also improves > its performance for normal hotplug memory. While here, it also reorganizes > pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.12-rc1. > > Cc:

[PATCH] arm64/mm: Fix __enable_mmu() for new TGRAN range values

2021-03-05 Thread Anshuman Khandual
Morse Cc: Suzuki K Poulose Cc: Ard Biesheuvel Cc: Mark Rutland Cc: linux-arm-ker...@lists.infradead.org Cc: kvm...@lists.cs.columbia.edu Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: James Morse Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/sysreg.h

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-03 Thread Anshuman Khandual
On 3/4/21 2:54 AM, Will Deacon wrote: > On Wed, Mar 03, 2021 at 07:04:33PM +, Catalin Marinas wrote: >> On Thu, Feb 11, 2021 at 01:35:56PM +0100, David Hildenbrand wrote: >>> On 11.02.21 13:10, Anshuman Khandual wrote: >>>> On 2/11/21 5:23 PM, Will Deacon wrote

Re: [PATCH V2] mm: Generalize HUGETLB_PAGE_SIZE_VARIABLE

2021-03-03 Thread Anshuman Khandual
On 3/2/21 10:43 AM, Anshuman Khandual wrote: > HUGETLB_PAGE_SIZE_VARIABLE need not be defined for each individual > platform subscribing it. Instead just make it generic. > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Andrew Morton &g

[PATCH V2] mm: Define default value for FIRST_USER_ADDRESS

2021-04-15 Thread Anshuman Khandual
Morton Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on v5.12-rc7 and has been boot tested on arm64 platform. But has been cross compiled on multiple other platforms. Changes in V2: - Dropped ARCH_HAS_FIRST_USER_ADDRES

Re: [PATCH V2] mm/page_alloc: Ensure that HUGETLB_PAGE_ORDER is less than MAX_ORDER

2021-04-12 Thread Anshuman Khandual
+ linuxppc-...@lists.ozlabs.org + linux-i...@vger.kernel.org On 4/12/21 9:18 AM, Anshuman Khandual wrote: > pageblock_order must always be less than MAX_ORDER, otherwise it might lead > to an warning during boot. A similar problem got fixed on arm64 platform > with the commit 79cc2ed5a71

Re: [PATCH V2 4/6] mm: Drop redundant ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION

2021-04-12 Thread Anshuman Khandual
On 4/12/21 5:29 PM, Oscar Salvador wrote: > On Thu, Apr 01, 2021 at 12:14:06PM +0530, Anshuman Khandual wrote: >> ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION configs have duplicate definitions on >> platforms that subscribe them. Drop these reduntant definitions and instead >

[PATCH] mm: Define ARCH_HAS_FIRST_USER_ADDRESS

2021-04-13 Thread Anshuman Khandual
Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/alpha/include/asm/pgtable.h | 1 - arch/arc/include/asm/pgtable.h | 6 -- arch/arm/Kconfig | 1 + arch/arm64/include/asm/pgtable.h | 2 -- arch/csky

Re: [PATCH] mm: Define ARCH_HAS_FIRST_USER_ADDRESS

2021-04-13 Thread Anshuman Khandual
On 4/14/21 10:52 AM, Christophe Leroy wrote: > > > Le 14/04/2021 à 04:54, Anshuman Khandual a écrit : >> Currently most platforms define FIRST_USER_ADDRESS as 0UL duplicating the >> same code all over. Instead define a new option ARCH_HAS_FIRST_USER_ADDRESS >> for

Re: [PATCH] mm: Define ARCH_HAS_FIRST_USER_ADDRESS

2021-04-14 Thread Anshuman Khandual
On 4/14/21 11:40 AM, Christophe Leroy wrote: > > > Le 14/04/2021 à 07:59, Anshuman Khandual a écrit : >> >> >> On 4/14/21 10:52 AM, Christophe Leroy wrote: >>> >>> >>> Le 14/04/2021 à 04:54, Anshuman Khandual a écrit : >>>> Cur

[PATCH V2 0/6] mm: some config cleanups

2021-03-31 Thread Anshuman Khandual
Changes in V2: - Rebased on 5.12-rc5 - Added tags from previous version Changes in V1: https://lore.kernel.org/linux-arm-kernel/1615278790-18053-1-git-send-email-anshuman.khand...@arm.com/ Anshuman Khandual (6): mm: Generalize ARCH_HAS_CACHE_LINE_SIZE mm: Generalize SYS_SUPPORTS_HUGETLBFS (rename

[PATCH V2 3/6] mm: Generalize ARCH_ENABLE_MEMORY_[HOTPLUG|HOTREMOVE]

2021-03-31 Thread Anshuman Khandual
: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Acked-by: Catalin Marinas (arm64) Acked-by: Heiko Carstens (s390) Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 8 ++-- arch/ia64/Kconf

[PATCH V2 4/6] mm: Drop redundant ARCH_ENABLE_[HUGEPAGE|THP]_MIGRATION

2021-03-31 Thread Anshuman Khandual
: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Andrew Morton Cc: x...@kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Acked-by: Catalin Marinas (arm64) Signed-off-by: Anshuma

[PATCH V2 RESEND] mm/memtest: Add ARCH_USE_MEMTEST

2021-04-01 Thread Anshuman Khandual
-...@lists.ozlabs.org Cc: linux-xte...@linux-xtensa.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Acked-by: Catalin Marinas (arm64) Reviewed-by: Max Filippov Signed-off-by: Anshuman Khandual --- This patch applies on v5.12-rc5 and has been tested on arm64 platform. But it has been

Re: [PATCH -next 2/3] mm/debug_vm_pgtable: Move {pmd/pud}_huge_tests out of CONFIG_TRANSPARENT_HUGEPAGE

2021-04-01 Thread Anshuman Khandual
On 4/1/21 7:53 AM, Shixin Liu wrote: > The functions {pmd/pud}_set_huge and {pmd/pud}_clear_huge is not depend on > THP. s/is not depend/are not dependent/ > But now if we want to test these functions, we have to enable THP. So move > {pmd/pud}_huge_tests out of CONFIG_TRANSPARENT_HUGEPAGE. P

Re: [PATCH -next 1/3] mm/debug_vm_pgtable: Fix one comment mistake

2021-04-01 Thread Anshuman Khandual
On 4/1/21 7:53 AM, Shixin Liu wrote: > The branch condition should be CONFIG_TRANSPARENT_HUGEPAGE instead of > CONFIG_ARCH_HAS_PTE_DEVMAP. > > Signed-off-by: Shixin Liu > --- > mm/debug_vm_pgtable.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/debug_vm_pgtab

Re: [PATCH -next 3/3] mm/debug_vm_pgtable: Remove useless pfn_pmd()

2021-04-01 Thread Anshuman Khandual
On 4/1/21 7:53 AM, Shixin Liu wrote: > The call to pfn_pmd() here is redundant. > > Signed-off-by: Shixin Liu > --- > mm/debug_vm_pgtable.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c > index c379bbe42c2a..9f4c4a114229 100644 > --- a/

Re: [PATCH -next v2 1/2] mm/debug_vm_pgtable: Move {pmd/pud}_huge_tests out of CONFIG_TRANSPARENT_HUGEPAGE

2021-04-18 Thread Anshuman Khandual
On 4/9/21 9:35 AM, Anshuman Khandual wrote: > > On 4/6/21 10:18 AM, Shixin Liu wrote: >> v1->v2: >> Modified the commit message. > > Please avoid change log in the commit message, it should be after '---' > below the SOB statement. > >>

Re: [PATCH V2] mm/page_alloc: Ensure that HUGETLB_PAGE_ORDER is less than MAX_ORDER

2021-04-18 Thread Anshuman Khandual
On 4/12/21 2:17 PM, David Hildenbrand wrote: > On 12.04.21 10:06, Anshuman Khandual wrote: >> + linuxppc-...@lists.ozlabs.org >> + linux-i...@vger.kernel.org >> >> On 4/12/21 9:18 AM, Anshuman Khandual wrote: >>> pageblock_order must always be less than MAX_O

Re: [PATCH -next] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()

2021-04-09 Thread Anshuman Khandual
On 4/9/21 6:52 AM, Wei Yongjun wrote: > In case of error, the function devm_kasprintf() returns NULL > pointer not ERR_PTR(). The IS_ERR() test in the return value > check should be replaced with NULL test. Right. > > Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver") Again, dont think

[PATCH V2] mm/page_alloc: Ensure that HUGETLB_PAGE_ORDER is less than MAX_ORDER

2021-04-11 Thread Anshuman Khandual
PAGE_ORDER gets assigned as pageblock_order. This will help detect the problem earlier on platforms where HUGETLB_PAGE_SIZE_VARIABLE is enabled. Cc: David Hildenbrand Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- Changes in V2:

Re: [PATCH 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-08 Thread Anshuman Khandual
On 12/8/20 8:57 PM, Heiko Carstens wrote: > On Tue, Dec 08, 2020 at 09:46:18AM +0530, Anshuman Khandual wrote: >> This overrides arch_get_mappabble_range() on s390 platform which will be >> used with recently added generic framework. It drops a redundant similar >> chec

Re: [PATCH V2 0/2] mm/debug_vm_pgtable: Some minor updates

2020-12-08 Thread Anshuman Khandual
On 12/1/20 5:49 PM, Anshuman Khandual wrote: > This series contains some cleanups and new test suggestions from Catalin > from an earlier discussion. > > https://lore.kernel.org/linux-mm/20201123142237.GF17833@gaia/ > > This series is based on v5.10-rc6 and has been teste

Re: [PATCH 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-09 Thread Anshuman Khandual
On 12/9/20 8:27 PM, Heiko Carstens wrote: > On Wed, Dec 09, 2020 at 08:07:04AM +0530, Anshuman Khandual wrote: >>>> + if (seg->end + 1 > VMEM_MAX_PHYS || seg->end + 1 < seg->start_addr) { >>>> + rc = -ERANGE; >>>> + goto o

Re: [PATCH 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-09 Thread Anshuman Khandual
On 12/10/20 12:34 PM, David Hildenbrand wrote: > >> Am 10.12.2020 um 07:58 schrieb Heiko Carstens : >> >> On Thu, Dec 10, 2020 at 09:48:11AM +0530, Anshuman Khandual wrote: >>>>> Alternatively leaving __segment_load() and vmem_add_memory() unchanged >

Re: [PATCH 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-10 Thread Anshuman Khandual
On 12/10/20 1:32 PM, David Hildenbrand wrote: > On 10.12.20 08:40, Anshuman Khandual wrote: >> >> >> On 12/10/20 12:34 PM, David Hildenbrand wrote: >>> >>>> Am 10.12.2020 um 07:58 schrieb Heiko Carstens : >>>> >>>>

Re: [PATCH] arm/smp: Drop the macro S(x,s)

2020-11-19 Thread Anshuman Khandual
On 11/9/20 5:17 PM, Anshuman Khandual wrote: > Mapping between IPI type index and its string is direct without requiring > an additional offset. Hence the existing macro S(x, s) is now redundant > and can just be dropped. This also makes the code clean and simple. > > Cc: Rus

Re: [PATCH] arm/mm: Convert PUD level pgtable helper macros into functions

2020-11-19 Thread Anshuman Khandual
On 11/10/20 9:06 AM, Anshuman Khandual wrote: > Macros used as functions can be problematic from the compiler perspective. > There was a build failure report caused primarily because of non reference > of an argument variable. Hence convert PUD level pgtable helper macros into >

Re: [PATCH 1/2] mm/debug_vm_pgtable/basic: Add validation for dirtiness after write protect

2020-11-30 Thread Anshuman Khandual
On 11/30/20 3:08 PM, Catalin Marinas wrote: > On Mon, Nov 30, 2020 at 09:55:00AM +0530, Anshuman Khandual wrote: >> On 11/27/20 3:14 PM, Catalin Marinas wrote: >>> On Fri, Nov 27, 2020 at 09:22:24AM +0100, Christophe Leroy wrote: >>>> Le 27/11/2020 à 06:06, Anshuman

Re: [PATCH 1/6] arm64: pgtable: Fix pte_accessible()

2020-11-24 Thread Anshuman Khandual
On 11/20/20 8:05 PM, Will Deacon wrote: > pte_accessible() is used by ptep_clear_flush() to figure out whether TLB > invalidation is necessary when unmapping pages for reclaim. Although our > implementation is correct according to the architecture, returning true > only for valid, young ptes in t

<    1   2   3   4   5   6   7   8   9   10   >