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]
Message-ID: <56CEC568.6080809@kyup.com>
Date:	Thu, 25 Feb 2016 11:12:08 +0200
From:	Nikolay Borisov <kernel@...p.com>
To:	Michal Hocko <mhocko@...nel.org>
Cc:	Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
	Theodore Ts'o <tytso@....edu>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Dmitry Monakhov <dmonakhov@...tuozzo.com>,
	Johannes Weiner <hannes@...xchg.org>,
	linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH RFC] ext4: use __GFP_NOFAIL in ext4_free_blocks()



On 02/25/2016 11:08 AM, Michal Hocko wrote:
> On Thu 25-02-16 11:01:32, Nikolay Borisov wrote:
>>
>>
>> On 02/24/2016 07:09 PM, Konstantin Khlebnikov wrote:
>>> This might be unexpected but pages allocated for sbi->s_buddy_cache are
>>> charged to current memory cgroup. So, GFP_NOFS allocation could fail if
>>> current task has been killed by OOM or if current memory cgroup has no
>>> free memory left. Block allocator cannot handle such failures here yet.
>>>
>>> Signed-off-by: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
>>
>> Adding new users of GFP_NOFAIL is deprecated.
> 
> This is not true. GFP_NOFAIL should be used where the allocation failure
> is no tolleratable and it is much more preferrable to doing an opencoded
> endless loop over page allocator.

In that case the comments in buffered_rmqueue, and the WARN_ON in
__alloc_pages_may_oom and __alloc_pages_slowpath perhaps should be
removed since they are misleading?

> 
>> Where exactly does the
>> block allocator fail, I skimmed the code and failing ext4_mb_load_buddy
>> seems to be handled at all call sites. There are some BUG_ONs but from
>> the comments there I guess they should occur when we try to find a page
>> and not allocate a new one?
> 
> I have posted a similar patch last year:
> http://lkml.kernel.org/r/1438768284-30927-6-git-send-email-mhocko@kernel.org
> because I could see emergency reboots when GFP_NOFS allocations were
> allowed to fail.
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ