* [PATCH] mm/page_alloc.c: variable type of 'progress' should be 'unsigned long'
@ 2020-09-15 10:46 yanfei.xu
2020-09-16 0:48 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: yanfei.xu @ 2020-09-15 10:46 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel
From: Yanfei Xu <yanfei.xu@windriver.com>
try_to_free_pages returns the number of pages reclaimed, and the type of
returns is 'unsigned long'. So we should use a matched type for storing
it.
Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
---
mm/page_alloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fab5e97dc9ca..5f1016c70b94 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4245,9 +4245,8 @@ static int
__perform_reclaim(gfp_t gfp_mask, unsigned int order,
const struct alloc_context *ac)
{
- int progress;
unsigned int noreclaim_flag;
- unsigned long pflags;
+ unsigned long pflags, progress;
cond_resched();
--
2.18.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/page_alloc.c: variable type of 'progress' should be 'unsigned long'
2020-09-15 10:46 [PATCH] mm/page_alloc.c: variable type of 'progress' should be 'unsigned long' yanfei.xu
@ 2020-09-16 0:48 ` Andrew Morton
2020-09-16 1:56 ` Xu, Yanfei
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2020-09-16 0:48 UTC (permalink / raw)
To: yanfei.xu; +Cc: linux-mm, linux-kernel
On Tue, 15 Sep 2020 18:46:20 +0800 <yanfei.xu@windriver.com> wrote:
> From: Yanfei Xu <yanfei.xu@windriver.com>
>
> try_to_free_pages returns the number of pages reclaimed, and the type of
> returns is 'unsigned long'. So we should use a matched type for storing
> it.
>
__perform_reclaim() returns an int, so this change is fairly pointless.
However __perform_reclaim()'s single caller expects it to return
unsigned long, so including that change in this patch would make more
sense.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/page_alloc.c: variable type of 'progress' should be 'unsigned long'
2020-09-16 0:48 ` Andrew Morton
@ 2020-09-16 1:56 ` Xu, Yanfei
0 siblings, 0 replies; 3+ messages in thread
From: Xu, Yanfei @ 2020-09-16 1:56 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, linux-kernel
On 9/16/20 8:48 AM, Andrew Morton wrote:
> On Tue, 15 Sep 2020 18:46:20 +0800 <yanfei.xu@windriver.com> wrote:
>
>> From: Yanfei Xu <yanfei.xu@windriver.com>
>>
>> try_to_free_pages returns the number of pages reclaimed, and the type of
>> returns is 'unsigned long'. So we should use a matched type for storing
>> it.
>>
>
> __perform_reclaim() returns an int, so this change is fairly pointless.
>
> However __perform_reclaim()'s single caller expects it to return
> unsigned long, so including that change in this patch would make more
> sense.
>
Yeah, thanks for reminding. I will add that and send a v2. :)
Regards,
Yanfei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-16 1:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 10:46 [PATCH] mm/page_alloc.c: variable type of 'progress' should be 'unsigned long' yanfei.xu
2020-09-16 0:48 ` Andrew Morton
2020-09-16 1:56 ` Xu, Yanfei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.