lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Nov 2023 12:23:24 +0530
From:   Charan Teja Kalla <quic_charante@...cinc.com>
To:     Pavan Kondeti <quic_pkondeti@...cinc.com>
CC:     Michal Hocko <mhocko@...e.com>, <akpm@...ux-foundation.org>,
        <mgorman@...hsingularity.net>, <david@...hat.com>,
        <vbabka@...e.cz>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: page_alloc: unreserve highatomic page blocks before
 oom



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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ