From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B22EC433F5 for ; Thu, 25 Nov 2021 21:31:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BDAE16B0075; Thu, 25 Nov 2021 16:30:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B8A7E6B0078; Thu, 25 Nov 2021 16:30:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A79386B007B; Thu, 25 Nov 2021 16:30:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id 973906B0075 for ; Thu, 25 Nov 2021 16:30:50 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5A6581856AD6A for ; Thu, 25 Nov 2021 21:30:40 +0000 (UTC) X-FDA: 78848747040.14.2515339 Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by imf03.hostedemail.com (Postfix) with ESMTP id C7F0630003C0 for ; Thu, 25 Nov 2021 21:30:35 +0000 (UTC) Received: from dread.disaster.area (pa49-195-103-97.pa.nsw.optusnet.com.au [49.195.103.97]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id DC29DAEF53; Fri, 26 Nov 2021 08:30:35 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1mqMKA-00DDU4-2a; Fri, 26 Nov 2021 08:30:34 +1100 Date: Fri, 26 Nov 2021 08:30:34 +1100 From: Dave Chinner To: Michal Hocko Cc: Andrew Morton , Neil Brown , Christoph Hellwig , Uladzislau Rezki , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, LKML , Ilya Dryomov , Jeff Layton , Sebastian Andrzej Siewior , Vlastimil Babka Subject: Re: [PATCH v2 0/4] extend vmalloc support for constrained allocations Message-ID: <20211125213034.GQ418105@dread.disaster.area> References: <20211122153233.9924-1-mhocko@kernel.org> <20211124225526.GM418105@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.4 cv=e9dl9Yl/ c=1 sm=1 tr=0 ts=61a0007d a=fP9RlOTWD4uZJjPSFnn6Ew==:117 a=fP9RlOTWD4uZJjPSFnn6Ew==:17 a=kj9zAlcOel0A:10 a=vIxV3rELxO4A:10 a=VwQbUJbxAAAA:8 a=iox4zFpeAAAA:8 a=20KFwNOVAAAA:8 a=7-415B0cAAAA:8 a=wFkKJAiL46mAdfXxsecA:9 a=CjuIK1q_8ugA:10 a=AjGcO6oz07-iQ99wixmX:22 a=WzC6qhA0u3u7Ye7llzcV:22 a=biEYGPWJfzWAr4FL6Ov7:22 X-Stat-Signature: 8os895nhkubjf4we1brybzoqsr1qa5zn Authentication-Results: imf03.hostedemail.com; dkim=none; spf=none (imf03.hostedemail.com: domain of david@fromorbit.com has no SPF policy when checking 211.29.132.80) smtp.mailfrom=david@fromorbit.com; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C7F0630003C0 X-HE-Tag: 1637875835-671260 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 25, 2021 at 10:30:28AM +0100, Michal Hocko wrote: > [Cc Sebastian and Vlastimil] > > On Thu 25-11-21 09:58:31, Michal Hocko wrote: > > On Thu 25-11-21 09:55:26, Dave Chinner wrote: > > [...] > > > Correct __GFP_NOLOCKDEP support is also needed. See: > > > > > > https://lore.kernel.org/linux-mm/20211119225435.GZ449541@dread.disaster.area/ > > > > I will have a closer look. This will require changes on both vmalloc and > > sl?b sides. > > This should hopefully make the trick > --- > From 0082d29c771d831e5d1b9bb4c0a61d39bac017f0 Mon Sep 17 00:00:00 2001 > From: Michal Hocko > Date: Thu, 25 Nov 2021 10:20:16 +0100 > Subject: [PATCH] mm: make slab and vmalloc allocators __GFP_NOLOCKDEP aware > > sl?b and vmalloc allocators reduce the given gfp mask for their internal > needs. For that they use GFP_RECLAIM_MASK to preserve the reclaim > behavior and constrains. > > __GFP_NOLOCKDEP is not a part of that mask because it doesn't really > control the reclaim behavior strictly speaking. On the other hand > it tells the underlying page allocator to disable reclaim recursion > detection so arguably it should be part of the mask. > > Having __GFP_NOLOCKDEP in the mask will not alter the behavior in any > form so this change is safe pretty much by definition. It also adds > a support for this flag to SL?B and vmalloc allocators which will in > turn allow its use to kvmalloc as well. A lack of the support has been > noticed recently in http://lkml.kernel.org/r/20211119225435.GZ449541@dread.disaster.area > > Reported-by: Sebastian Andrzej Siewior > Signed-off-by: Michal Hocko > --- > mm/internal.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/internal.h b/mm/internal.h > index 3b79a5c9427a..2ceea20b5b2a 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -21,7 +21,7 @@ > #define GFP_RECLAIM_MASK (__GFP_RECLAIM|__GFP_HIGH|__GFP_IO|__GFP_FS|\ > __GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NOFAIL|\ > __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC|\ > - __GFP_ATOMIC) > + __GFP_ATOMIC|__GFP_NOLOCKDEP) > > /* The GFP flags allowed during early boot */ > #define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_RECLAIM|__GFP_IO|__GFP_FS)) Looks reasonable to me. Acked-by: Dave Chinner Cheers, Dave. -- Dave Chinner david@fromorbit.com