linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] sparc: Fix handling of page table constructor failure
@ 2020-11-25  3:46 Matthew Wilcox (Oracle)
  2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Matthew Wilcox (Oracle) @ 2020-11-25  3:46 UTC (permalink / raw)
  To: akpm
  Cc: Matthew Wilcox (Oracle), davem, rppt, sparclinux, linux-kernel, linux-mm

The page has just been allocated, so its refcount is 1.  free_unref_page()
is for use on pages which have a zero refcount.  Use __free_page()
like the other implementations of pte_alloc_one().

Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 arch/sparc/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 96edf64d4fb3..182bb7bdaa0a 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
 	if (!page)
 		return NULL;
 	if (!pgtable_pte_page_ctor(page)) {
-		free_unref_page(page);
+		__free_page(page);
 		return NULL;
 	}
 	return (pte_t *) page_address(page);
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] mm: Move free_unref_page to mm/internal.h
  2020-11-25  3:46 [PATCH 1/2] sparc: Fix handling of page table constructor failure Matthew Wilcox (Oracle)
@ 2020-11-25  3:46 ` Matthew Wilcox (Oracle)
  2020-11-25  8:43   ` David Hildenbrand
                     ` (2 more replies)
  2020-11-25  8:43 ` [PATCH 1/2] sparc: Fix handling of page table constructor failure David Hildenbrand
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 11+ messages in thread
From: Matthew Wilcox (Oracle) @ 2020-11-25  3:46 UTC (permalink / raw)
  To: akpm
  Cc: Matthew Wilcox (Oracle), davem, rppt, sparclinux, linux-kernel, linux-mm

Code outside mm/ should not be calling free_unref_page().  Also
move free_unref_page_list().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/gfp.h | 2 --
 mm/internal.h       | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index c603237e006c..6e479e9c48ce 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -580,8 +580,6 @@ void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
 
 extern void __free_pages(struct page *page, unsigned int order);
 extern void free_pages(unsigned long addr, unsigned int order);
-extern void free_unref_page(struct page *page);
-extern void free_unref_page_list(struct list_head *list);
 
 struct page_frag_cache;
 extern void __page_frag_cache_drain(struct page *page, unsigned int count);
diff --git a/mm/internal.h b/mm/internal.h
index 75ae680d0a2c..5864815947fe 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -201,6 +201,9 @@ extern void post_alloc_hook(struct page *page, unsigned int order,
 					gfp_t gfp_flags);
 extern int user_min_free_kbytes;
 
+extern void free_unref_page(struct page *page);
+extern void free_unref_page_list(struct list_head *list);
+
 extern void zone_pcp_update(struct zone *zone);
 extern void zone_pcp_reset(struct zone *zone);
 extern void zone_pcp_disable(struct zone *zone);
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] sparc: Fix handling of page table constructor failure
  2020-11-25  3:46 [PATCH 1/2] sparc: Fix handling of page table constructor failure Matthew Wilcox (Oracle)
  2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
@ 2020-11-25  8:43 ` David Hildenbrand
  2020-11-25 12:10   ` Matthew Wilcox
  2020-11-25  8:57 ` Mike Rapoport
  2020-11-25 12:30 ` Vlastimil Babka
  3 siblings, 1 reply; 11+ messages in thread
From: David Hildenbrand @ 2020-11-25  8:43 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), akpm
  Cc: davem, rppt, sparclinux, linux-kernel, linux-mm

On 25.11.20 04:46, Matthew Wilcox (Oracle) wrote:
> The page has just been allocated, so its refcount is 1.  free_unref_page()
> is for use on pages which have a zero refcount.  Use __free_page()
> like the other implementations of pte_alloc_one().
> 
> Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  arch/sparc/mm/init_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> index 96edf64d4fb3..182bb7bdaa0a 100644
> --- a/arch/sparc/mm/init_64.c
> +++ b/arch/sparc/mm/init_64.c
> @@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
>  	if (!page)
>  		return NULL;
>  	if (!pgtable_pte_page_ctor(page)) {
> -		free_unref_page(page);
> +		__free_page(page);
>  		return NULL;
>  	}
>  	return (pte_t *) page_address(page);
> 

I wonder if reusing __pte_alloc_one() - e.g., internally - would be even
cleaner.

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mm: Move free_unref_page to mm/internal.h
  2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
@ 2020-11-25  8:43   ` David Hildenbrand
  2020-11-25  8:58   ` Mike Rapoport
  2020-11-25 12:34   ` Vlastimil Babka
  2 siblings, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2020-11-25  8:43 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), akpm
  Cc: davem, rppt, sparclinux, linux-kernel, linux-mm

On 25.11.20 04:46, Matthew Wilcox (Oracle) wrote:
> Code outside mm/ should not be calling free_unref_page().  Also
> move free_unref_page_list().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  include/linux/gfp.h | 2 --
>  mm/internal.h       | 3 +++
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index c603237e006c..6e479e9c48ce 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -580,8 +580,6 @@ void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
>  
>  extern void __free_pages(struct page *page, unsigned int order);
>  extern void free_pages(unsigned long addr, unsigned int order);
> -extern void free_unref_page(struct page *page);
> -extern void free_unref_page_list(struct list_head *list);
>  
>  struct page_frag_cache;
>  extern void __page_frag_cache_drain(struct page *page, unsigned int count);
> diff --git a/mm/internal.h b/mm/internal.h
> index 75ae680d0a2c..5864815947fe 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -201,6 +201,9 @@ extern void post_alloc_hook(struct page *page, unsigned int order,
>  					gfp_t gfp_flags);
>  extern int user_min_free_kbytes;
>  
> +extern void free_unref_page(struct page *page);
> +extern void free_unref_page_list(struct list_head *list);
> +
>  extern void zone_pcp_update(struct zone *zone);
>  extern void zone_pcp_reset(struct zone *zone);
>  extern void zone_pcp_disable(struct zone *zone);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] sparc: Fix handling of page table constructor failure
  2020-11-25  3:46 [PATCH 1/2] sparc: Fix handling of page table constructor failure Matthew Wilcox (Oracle)
  2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
  2020-11-25  8:43 ` [PATCH 1/2] sparc: Fix handling of page table constructor failure David Hildenbrand
@ 2020-11-25  8:57 ` Mike Rapoport
  2020-11-25 12:30 ` Vlastimil Babka
  3 siblings, 0 replies; 11+ messages in thread
From: Mike Rapoport @ 2020-11-25  8:57 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle); +Cc: akpm, davem, sparclinux, linux-kernel, linux-mm

On Wed, Nov 25, 2020 at 03:46:54AM +0000, Matthew Wilcox (Oracle) wrote:
> The page has just been allocated, so its refcount is 1.  free_unref_page()
> is for use on pages which have a zero refcount.  Use __free_page()
> like the other implementations of pte_alloc_one().
> 
> Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  arch/sparc/mm/init_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> index 96edf64d4fb3..182bb7bdaa0a 100644
> --- a/arch/sparc/mm/init_64.c
> +++ b/arch/sparc/mm/init_64.c
> @@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
>  	if (!page)
>  		return NULL;
>  	if (!pgtable_pte_page_ctor(page)) {
> -		free_unref_page(page);
> +		__free_page(page);
>  		return NULL;
>  	}
>  	return (pte_t *) page_address(page);
> -- 
> 2.29.2
> 

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mm: Move free_unref_page to mm/internal.h
  2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
  2020-11-25  8:43   ` David Hildenbrand
@ 2020-11-25  8:58   ` Mike Rapoport
  2020-11-25 12:34   ` Vlastimil Babka
  2 siblings, 0 replies; 11+ messages in thread
From: Mike Rapoport @ 2020-11-25  8:58 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle); +Cc: akpm, davem, sparclinux, linux-kernel, linux-mm

On Wed, Nov 25, 2020 at 03:46:55AM +0000, Matthew Wilcox (Oracle) wrote:
> Code outside mm/ should not be calling free_unref_page().  Also
> move free_unref_page_list().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  include/linux/gfp.h | 2 --
>  mm/internal.h       | 3 +++
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index c603237e006c..6e479e9c48ce 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -580,8 +580,6 @@ void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
>  
>  extern void __free_pages(struct page *page, unsigned int order);
>  extern void free_pages(unsigned long addr, unsigned int order);
> -extern void free_unref_page(struct page *page);
> -extern void free_unref_page_list(struct list_head *list);
>  
>  struct page_frag_cache;
>  extern void __page_frag_cache_drain(struct page *page, unsigned int count);
> diff --git a/mm/internal.h b/mm/internal.h
> index 75ae680d0a2c..5864815947fe 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -201,6 +201,9 @@ extern void post_alloc_hook(struct page *page, unsigned int order,
>  					gfp_t gfp_flags);
>  extern int user_min_free_kbytes;
>  
> +extern void free_unref_page(struct page *page);
> +extern void free_unref_page_list(struct list_head *list);
> +
>  extern void zone_pcp_update(struct zone *zone);
>  extern void zone_pcp_reset(struct zone *zone);
>  extern void zone_pcp_disable(struct zone *zone);
> -- 
> 2.29.2
> 

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] sparc: Fix handling of page table constructor failure
  2020-11-25  8:43 ` [PATCH 1/2] sparc: Fix handling of page table constructor failure David Hildenbrand
@ 2020-11-25 12:10   ` Matthew Wilcox
  2020-11-25 13:24     ` David Hildenbrand
  0 siblings, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2020-11-25 12:10 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: akpm, davem, rppt, sparclinux, linux-kernel, linux-mm

On Wed, Nov 25, 2020 at 09:43:15AM +0100, David Hildenbrand wrote:
> On 25.11.20 04:46, Matthew Wilcox (Oracle) wrote:
> > The page has just been allocated, so its refcount is 1.  free_unref_page()
> > is for use on pages which have a zero refcount.  Use __free_page()
> > like the other implementations of pte_alloc_one().
> > 
> > Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> > ---
> >  arch/sparc/mm/init_64.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> > index 96edf64d4fb3..182bb7bdaa0a 100644
> > --- a/arch/sparc/mm/init_64.c
> > +++ b/arch/sparc/mm/init_64.c
> > @@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
> >  	if (!page)
> >  		return NULL;
> >  	if (!pgtable_pte_page_ctor(page)) {
> > -		free_unref_page(page);
> > +		__free_page(page);
> >  		return NULL;
> >  	}
> >  	return (pte_t *) page_address(page);
> > 
> 
> I wonder if reusing __pte_alloc_one() - e.g., internally - would be even
> cleaner.

It's really awkward to do because pgtable_t is defined differently.
The clean thing to do would be:

--- arch/sparc/include/asm/page_64.h
-typedef pte_t *pgtable_t;
+typedef struct page *pgtable_t;

and then do all the other changes that would require.

But that feels like a lot more work than appropriate to fix this
unlikely bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] sparc: Fix handling of page table constructor failure
  2020-11-25  3:46 [PATCH 1/2] sparc: Fix handling of page table constructor failure Matthew Wilcox (Oracle)
                   ` (2 preceding siblings ...)
  2020-11-25  8:57 ` Mike Rapoport
@ 2020-11-25 12:30 ` Vlastimil Babka
  3 siblings, 0 replies; 11+ messages in thread
From: Vlastimil Babka @ 2020-11-25 12:30 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), akpm
  Cc: davem, rppt, sparclinux, linux-kernel, linux-mm

On 11/25/20 4:46 AM, Matthew Wilcox (Oracle) wrote:
> The page has just been allocated, so its refcount is 1.  free_unref_page()
> is for use on pages which have a zero refcount.  Use __free_page()
> like the other implementations of pte_alloc_one().
> 
> Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>   arch/sparc/mm/init_64.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
> index 96edf64d4fb3..182bb7bdaa0a 100644
> --- a/arch/sparc/mm/init_64.c
> +++ b/arch/sparc/mm/init_64.c
> @@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
>   	if (!page)
>   		return NULL;
>   	if (!pgtable_pte_page_ctor(page)) {
> -		free_unref_page(page);
> +		__free_page(page);
>   		return NULL;
>   	}
>   	return (pte_t *) page_address(page);
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mm: Move free_unref_page to mm/internal.h
  2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
  2020-11-25  8:43   ` David Hildenbrand
  2020-11-25  8:58   ` Mike Rapoport
@ 2020-11-25 12:34   ` Vlastimil Babka
  2020-11-25 12:46     ` Matthew Wilcox
  2 siblings, 1 reply; 11+ messages in thread
From: Vlastimil Babka @ 2020-11-25 12:34 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), akpm
  Cc: davem, rppt, sparclinux, linux-kernel, linux-mm

On 11/25/20 4:46 AM, Matthew Wilcox (Oracle) wrote:
> Code outside mm/ should not be calling free_unref_page().  Also
> move free_unref_page_list().

Good idea.

> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

There seems to be some effort to remove "extern" from function 
declarations from headers. Do we want to do that, at once, or piecemeal? 
If the latter, this is a chance for these functions at least :)

> ---
>   include/linux/gfp.h | 2 --
>   mm/internal.h       | 3 +++
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index c603237e006c..6e479e9c48ce 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -580,8 +580,6 @@ void * __meminit alloc_pages_exact_nid(int nid, size_t size, gfp_t gfp_mask);
>   
>   extern void __free_pages(struct page *page, unsigned int order);
>   extern void free_pages(unsigned long addr, unsigned int order);
> -extern void free_unref_page(struct page *page);
> -extern void free_unref_page_list(struct list_head *list);
>   
>   struct page_frag_cache;
>   extern void __page_frag_cache_drain(struct page *page, unsigned int count);
> diff --git a/mm/internal.h b/mm/internal.h
> index 75ae680d0a2c..5864815947fe 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -201,6 +201,9 @@ extern void post_alloc_hook(struct page *page, unsigned int order,
>   					gfp_t gfp_flags);
>   extern int user_min_free_kbytes;
>   
> +extern void free_unref_page(struct page *page);
> +extern void free_unref_page_list(struct list_head *list);
> +
>   extern void zone_pcp_update(struct zone *zone);
>   extern void zone_pcp_reset(struct zone *zone);
>   extern void zone_pcp_disable(struct zone *zone);
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] mm: Move free_unref_page to mm/internal.h
  2020-11-25 12:34   ` Vlastimil Babka
@ 2020-11-25 12:46     ` Matthew Wilcox
  0 siblings, 0 replies; 11+ messages in thread
From: Matthew Wilcox @ 2020-11-25 12:46 UTC (permalink / raw)
  To: Vlastimil Babka; +Cc: akpm, davem, rppt, sparclinux, linux-kernel, linux-mm

On Wed, Nov 25, 2020 at 01:34:04PM +0100, Vlastimil Babka wrote:
> On 11/25/20 4:46 AM, Matthew Wilcox (Oracle) wrote:
> > Code outside mm/ should not be calling free_unref_page().  Also
> > move free_unref_page_list().
> 
> Good idea.
> 
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> 
> There seems to be some effort to remove "extern" from function declarations
> from headers. Do we want to do that, at once, or piecemeal? If the latter,
> this is a chance for these functions at least :)

I'm generally in favour of those efforts, but since I was just moving
the function declarations, and all the code near the destination was
using 'extern', I decided not to remove it so as to avoid getting caught
up in bikeshedding ...


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] sparc: Fix handling of page table constructor failure
  2020-11-25 12:10   ` Matthew Wilcox
@ 2020-11-25 13:24     ` David Hildenbrand
  0 siblings, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2020-11-25 13:24 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: akpm, davem, rppt, sparclinux, linux-kernel, linux-mm

On 25.11.20 13:10, Matthew Wilcox wrote:
> On Wed, Nov 25, 2020 at 09:43:15AM +0100, David Hildenbrand wrote:
>> On 25.11.20 04:46, Matthew Wilcox (Oracle) wrote:
>>> The page has just been allocated, so its refcount is 1.  free_unref_page()
>>> is for use on pages which have a zero refcount.  Use __free_page()
>>> like the other implementations of pte_alloc_one().
>>>
>>> Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
>>> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>>> ---
>>>  arch/sparc/mm/init_64.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
>>> index 96edf64d4fb3..182bb7bdaa0a 100644
>>> --- a/arch/sparc/mm/init_64.c
>>> +++ b/arch/sparc/mm/init_64.c
>>> @@ -2894,7 +2894,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
>>>  	if (!page)
>>>  		return NULL;
>>>  	if (!pgtable_pte_page_ctor(page)) {
>>> -		free_unref_page(page);
>>> +		__free_page(page);
>>>  		return NULL;
>>>  	}
>>>  	return (pte_t *) page_address(page);
>>>
>>
>> I wonder if reusing __pte_alloc_one() - e.g., internally - would be even
>> cleaner.
> 
> It's really awkward to do because pgtable_t is defined differently.
> The clean thing to do would be:
> 
> --- arch/sparc/include/asm/page_64.h
> -typedef pte_t *pgtable_t;
> +typedef struct page *pgtable_t;
> 
> and then do all the other changes that would require.
> 
> But that feels like a lot more work than appropriate to fix this
> unlikely bug.

Yeah, cleanups would have to come on top of the fix of course. But I can
understand that you have plenty of better things to do :) ... maybe
sparc people want to work on that at one point.

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-11-25 13:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  3:46 [PATCH 1/2] sparc: Fix handling of page table constructor failure Matthew Wilcox (Oracle)
2020-11-25  3:46 ` [PATCH 2/2] mm: Move free_unref_page to mm/internal.h Matthew Wilcox (Oracle)
2020-11-25  8:43   ` David Hildenbrand
2020-11-25  8:58   ` Mike Rapoport
2020-11-25 12:34   ` Vlastimil Babka
2020-11-25 12:46     ` Matthew Wilcox
2020-11-25  8:43 ` [PATCH 1/2] sparc: Fix handling of page table constructor failure David Hildenbrand
2020-11-25 12:10   ` Matthew Wilcox
2020-11-25 13:24     ` David Hildenbrand
2020-11-25  8:57 ` Mike Rapoport
2020-11-25 12:30 ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).