[PATCH v8 07/19] arc: mm: Convert to GENERIC_IOREMAP

2023-07-06 Thread Baoquan He
;s special operation when ioremap_prot() and iounmap(). Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Reviewed-by: Mike Rapoport (IBM) Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 +++--- arch/arc/mm/ioremap.

[PATCH v7 07/19] arc: mm: Convert to GENERIC_IOREMAP

2023-06-20 Thread Baoquan He
;s special operation when ioremap_prot() and iounmap(). Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Reviewed-by: Mike Rapoport (IBM) Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 +++--- arch/arc/mm/ioremap.

[PATCH v6 07/19] arc: mm: Convert to GENERIC_IOREMAP

2023-06-09 Thread Baoquan He
;s special operation when ioremap_prot() and iounmap(). Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Reviewed-by: Mike Rapoport (IBM) Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 +++--- arch/arc/mm/ioremap.

Re: [PATCH v5 RESEND 07/17] arc: mm: Convert to GENERIC_IOREMAP

2023-05-30 Thread Baoquan He
Hi Christoph, On 05/16/23 at 11:31pm, Christoph Hellwig wrote: > > +#define ioremap ioremap > > +#define ioremap_prot ioremap_prot > > +#define iounmap iounmap > > Nit: I think it's cleaner to have these #defines right next to the > function declaration. For this one, I didn't add function decl

Re: [PATCH v5 RESEND 07/17] arc: mm: Convert to GENERIC_IOREMAP

2023-05-17 Thread Baoquan He
On 05/16/23 at 11:31pm, Christoph Hellwig wrote: > > +#define ioremap ioremap > > +#define ioremap_prot ioremap_prot > > +#define iounmap iounmap > > Nit: I think it's cleaner to have these #defines right next to the > function declaration. Makes sense, will do. > > Otherwise looks good: > >

[PATCH v5 RESEND 07/17] arc: mm: Convert to GENERIC_IOREMAP

2023-05-15 Thread Baoquan He
;s special operation when ioremap_prot() and iounmap(). Signed-off-by: Baoquan He Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 +++--- arch/arc/mm/ioremap.c | 49 --- 3 files

[PATCH v5 07/17] arc: mm: Convert to GENERIC_IOREMAP

2023-02-28 Thread Baoquan He
;s special operation when ioremap_prot() and iounmap(). Signed-off-by: Baoquan He Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 +++--- arch/arc/mm/ioremap.c | 49 --- 3 files

[PATCH v4 06/16] arc: mm: Convert to GENERIC_IOREMAP

2023-02-16 Thread Baoquan He
;s special operation when ioremap_prot() and iounmap(). Signed-off-by: Baoquan He Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Signed-off-by: Christophe Leroy --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 7 +++--- arch/arc/mm/ioremap.

Re: [PATCH v3 05/11] arc: mm: Convert to GENERIC_IOREMAP

2022-10-13 Thread Baoquan He
On 10/12/22 at 10:17am, Christophe Leroy wrote: .. > > -/* > > - * ioremap with access flags > > - * Cache semantics wise it is same as ioremap - "forced" uncached. > > - * However unlike vanilla ioremap which bypasses ARC MMU for addresses in > > - * ARC hardware uncached region, this one stil

[PATCH v3 05/11] arc: mm: Convert to GENERIC_IOREMAP

2022-10-09 Thread Baoquan He
because arc has some special handling in ioremap() than standard ioremap(). Signed-off-by: Baoquan He Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig | 1 + arch/arc/include/asm/io.h | 19 + arch/arc/mm/ior

[PATCH v2 04/11] arc: mm: Convert to GENERIC_IOREMAP

2022-08-19 Thread Baoquan He
Add hooks arch_ioremap() and arch_iounmap() for arc's special operation when ioremap_prot() and iounmap(). Meanwhile define and implement arc's own ioremap() because arc has some special handling in ioremap() than standard ioremap(). Signed-off-by: Baoquan He Cc: Vineet Gupta Cc: linu

[PATCH 04/11] arc: mm: Convert to GENERIC_IOREMAP

2022-08-01 Thread Baoquan He
Add hooks ioremap_allowed() and iounmap_allowed() for arc's special operation when ioremap_prot() and iounmap(). Meanwhile define and implement arc's own ioremap() because arc has some special handling in ioremap() than standard ioremap(). Signed-off-by: Baoquan He Cc: Vineet Gupta

Re: [PATCH 17/21] mm: free_area_init: allow defining max_zone_pfn in descending order

2020-04-23 Thread Baoquan He
On 04/23/20 at 08:55am, Mike Rapoport wrote: > On Thu, Apr 23, 2020 at 10:57:20AM +0800, Baoquan He wrote: > > On 04/23/20 at 10:53am, Baoquan He wrote: > > > On 04/12/20 at 10:48pm, Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > >

Re: [PATCH 18/21] mm: rename free_area_init_node() to free_area_init_memoryless_node()

2020-04-22 Thread Baoquan He
On 04/12/20 at 10:48pm, Mike Rapoport wrote: > From: Mike Rapoport > > The free_area_init_node() is only used by x86 to initialize a memory-less > nodes. > Make its name reflect this and drop all the function parameters except node > ID as they are anyway zero. > > Signed-off-by: Mike Rapoport

Re: [PATCH 17/21] mm: free_area_init: allow defining max_zone_pfn in descending order

2020-04-22 Thread Baoquan He
On 04/23/20 at 10:53am, Baoquan He wrote: > On 04/12/20 at 10:48pm, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Some architectures (e.g. ARC) have the ZONE_HIGHMEM zone below the > > ZONE_NORMAL. Allowing free_area_init() parse max_zone_pfn array even it

Re: [PATCH 17/21] mm: free_area_init: allow defining max_zone_pfn in descending order

2020-04-22 Thread Baoquan He
On 04/12/20 at 10:48pm, Mike Rapoport wrote: > From: Mike Rapoport > > Some architectures (e.g. ARC) have the ZONE_HIGHMEM zone below the > ZONE_NORMAL. Allowing free_area_init() parse max_zone_pfn array even it is > sorted in descending order allows using free_area_init() on such > architectures

Re: [PATCH 16/21] mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES

2020-04-22 Thread Baoquan He
y_pfnnid_cache); > - if (nid >= 0 && nid != node) > - return false; > - return true; > -} > - > -#else > -static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node) > -{ > - return true; > -} > -#endif And macro early_pfn_valid() is not

Re: [PATCH 05/21] mm: use free_area_init() instead of free_area_init_nodes()

2020-04-22 Thread Baoquan He
lise all pg_data_t and zone data > * @max_zone_pfn: an array of max PFNs for each zone > * > * This will call free_area_init_node() for each active node in the system. It's __free_area_init_node() here being called, while it dosn't matter much because it's

Re: [PATCH 04/21] mm: free_area_init: use maximal zone PFNs rather than zone sizes

2020-04-22 Thread Baoquan He
lude/linux/mm.h > +++ b/include/linux/mm.h > @@ -2272,7 +2272,7 @@ static inline spinlock_t *pud_lock(struct mm_struct > *mm, pud_t *pud) > } > > extern void __init pagecache_init(void); > -extern void free_area_init(unsigned long * zones_size); > +extern void free_area_

Re: [PATCH 03/21] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option

2020-04-21 Thread Baoquan He
On 04/21/20 at 12:09pm, Mike Rapoport wrote: > > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > > > index fc0aad0bc1f5..e67dc501576a 100644 > > > --- a/mm/memory_hotplug.c > > > +++ b/mm/memory_hotplug.c > > > @@ -1372,11 +1372,7 @@ check_pages_isolated_cb(unsigned long start_pfn, > >

Re: [PATCH 02/21] mm: make early_pfn_to_nid() and related defintions close to each other

2020-04-21 Thread Baoquan He
On 04/21/20 at 11:49am, Mike Rapoport wrote: > On Tue, Apr 21, 2020 at 10:24:35AM +0800, Baoquan He wrote: > > On 04/12/20 at 10:48pm, Mike Rapoport wrote: > > > From: Mike Rapoport > > > > > > The early_pfn_to_nid() and it's helper __early_pfn_to_nid() a

Re: [PATCH 03/21] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option

2020-04-20 Thread Baoquan He
On 04/12/20 at 10:48pm, Mike Rapoport wrote: > From: Mike Rapoport > > The CONFIG_HAVE_MEMBLOCK_NODE_MAP is used to differentiate initialization > of nodes and zones structures between the systems that have region to node > mapping in memblock and those that don't. > > Currently all the NUMA arc

Re: [PATCH 02/21] mm: make early_pfn_to_nid() and related defintions close to each other

2020-04-20 Thread Baoquan He
On 04/12/20 at 10:48pm, Mike Rapoport wrote: > From: Mike Rapoport > > The early_pfn_to_nid() and it's helper __early_pfn_to_nid() are spread > around include/linux/mm.h, include/linux/mmzone.h and mm/page_alloc.c. > > Drop unused stub for __early_pfn_to_nid() and move its actual generic > imple

Re: [PATCH 02/21] mm: make early_pfn_to_nid() and related defintions close to each other

2020-04-20 Thread Baoquan He
ARLY_PFN_TO_NID) || \ defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) This is the upper layer of ifdeffery scope. > > static struct mminit_pfnnid_cache early_pfnnid_cache __meminitdata; > > +#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID Moving __early_pfn_to_nid() here makes the upper layer of ifdefer

Re: [PATCH 01/21] mm: memblock: replace dereferences of memblock_region.nid with API calls

2020-04-20 Thread Baoquan He
ck_is_hotpluggable(r)) > continue; > > - nid = r->nid; > + nid = memblock_get_region_node(r); > > usable_startpfn = PFN_DOWN(r->base); > zone_movable_pfn[nid] = zone_movable_pfn[nid] ? > @@