linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Charan Teja Kalla <quic_charante@quicinc.com>
To: Pavan Kondeti <quic_pkondeti@quicinc.com>
Cc: Michal Hocko <mhocko@suse.com>, <akpm@linux-foundation.org>,
	<mgorman@techsingularity.net>, <david@redhat.com>,
	<vbabka@suse.cz>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: page_alloc: unreserve highatomic page blocks before oom
Date: Wed, 1 Nov 2023 12:23:24 +0530	[thread overview]
Message-ID: <ca6093e6-fc85-9ce8-71a1-77d8996c9fd6@quicinc.com> (raw)
In-Reply-To: <37c58833-1953-42c3-98c6-ee0ac75508ce@quicinc.com>



On 11/1/2023 12:16 PM, Pavan Kondeti wrote:
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 2a2536d..41441ced 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -1886,7 +1886,9 @@ static void reserve_highatomic_pageblock(struct
>> page *page, struct zone *zone)
>>          * Limit the number reserved to 1 pageblock or roughly 1% of a zone.
>>          * Check is race-prone but harmless.
>>          */
>> -       max_managed = (zone_managed_pages(zone) / 100) + pageblock_nr_pages;
>> +       max_managed = max_t(unsigned long,
>> +                       ALIGN(zone_managed_pages(zone) / 100,
>> pageblock_nr_pages),
>> +                       pageblock_nr_pages);
>>         if (zone->nr_reserved_highatomic >= max_managed)
>>                 return;
>>
> ALIGN() rounds up the value, so max_t() is not needed here. If you had
> used ALIGN_DOWN() then max_t() can be used to keep atleast
> pageblock_nr_pages pages.
> 
Yeah, just ALIGN() enough here.
> 
> Also, add below Fixes tag if it makes sense.
> 
> Fixes: 04c8716f7b00 ("mm: try to exhaust highatomic reserve before the OOM")
I should be adding this.


  reply	other threads:[~2023-11-01  6:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 12:39 Charan Teja Kalla
2023-10-31  7:53 ` Pavan Kondeti
2023-10-31  8:14 ` Michal Hocko
2023-10-31 13:13   ` Charan Teja Kalla
2023-10-31 13:43     ` Michal Hocko
2023-11-01  6:46     ` Pavan Kondeti
2023-11-01  6:53       ` Charan Teja Kalla [this message]
2023-11-01  9:41         ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca6093e6-fc85-9ce8-71a1-77d8996c9fd6@quicinc.com \
    --to=quic_charante@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=quic_pkondeti@quicinc.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox