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 16C35C5321D for ; Mon, 26 Aug 2024 20:01:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E52A6B0083; Mon, 26 Aug 2024 16:01:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 994D86B008A; Mon, 26 Aug 2024 16:01:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85C736B0092; Mon, 26 Aug 2024 16:01:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 680B36B0083 for ; Mon, 26 Aug 2024 16:01:06 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 13BB414136F for ; Mon, 26 Aug 2024 20:01:06 +0000 (UTC) X-FDA: 82495465332.16.4F025AA Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) by imf18.hostedemail.com (Postfix) with ESMTP id 6B8001C001B for ; Mon, 26 Aug 2024 20:01:03 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=qw8uJxn1; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724702400; a=rsa-sha256; cv=none; b=XS04HIyfdPxtsMUeBotsOyM79WHtb/jkaKpXVD3mFbtwC4nQA/FDpru13nokssR9NFoJMI UxB4UY81Dgeh4nHdopKF2Ij13eZUd9ZAAFN0o5BSUMg0KRojWI/4RgrqYi2Oy9pz8lW2/W yHQvtLZbRxaDVDSbimA925WFbhgoX/g= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=qw8uJxn1; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724702400; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=az5h4Wg9eeDfpa4hkRSMfQTELltA5ZhzvE5iac6003M=; b=7TcJhuGPEaxEjTRn9YZPVczscHU1Y19ruCmxt4TsQGq/3HDVfv658vGawRSXfbbUtnS0A+ kfxm1zpJNVIATBvjUI8t5/X7QoxGygapRstJ888B3k7UBsOoF9ln+ULTjswOzmD2wD4fg1 Tp57ivk9BwV5IfYCIkZAfk9WiPijSG8= Date: Mon, 26 Aug 2024 16:00:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724702461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=az5h4Wg9eeDfpa4hkRSMfQTELltA5ZhzvE5iac6003M=; b=qw8uJxn1gW3AIjoRXCaOoW9baIMfQYPdUt5yGVcp2ljM3f8FSs636XiLJ/PlF7EVKD8ZOH h2+RPLeHR2UKk8noJt+TjggJ0TJXjyKiPYFEKjWyojpuhp2tWhQVgAIH8g96M6JZJXDUGY hYd8/pVgwjE/UqWcbTSG7V8ePC/F4Uw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko Cc: Andrew Morton , Christoph Hellwig , Yafang Shao , jack@suse.cz, Christian Brauner , Alexander Viro , Paul Moore , James Morris , "Serge E. Hallyn" , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-bcachefs@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] bcachefs: do not use PF_MEMALLOC_NORECLAIM Message-ID: References: <20240826085347.1152675-1-mhocko@kernel.org> <20240826085347.1152675-2-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 6B8001C001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: hurfx6s7b3bowzk85uryqog9s1con1md X-HE-Tag: 1724702463-658675 X-HE-Meta: U2FsdGVkX19Cx+NQrLvhgmN9PgKD7SXTrDjdhe3XqhW51/6Kf2xK0aV+ITmCY/HfTTljpg3CSvhwsGpdcjqTMU7nOgn++HU9LjV7PX0VOA6Y1tr/TS3+6DmmTxN+crOfUZqn8t/Rr6MSS4blO0NaQ+Z7/hnCbXExrzqrPW5QjY2JuVO5NB5ZVAzVlvj00occpAocBjYDGdvBY4oAd75+MNUivNmTKNkKsmxihzF71Q8LgvNEOqIGgAwWrai4lRVKlEA8PIZ0LOoRov45+ZXLfUD44Vj7Wr0H7i5agCuiwS3gVduDdVgEMehZm958gz+fpeVj/kjzfAStOWx6phfryNXkPJOvZssShekK3ac9umrGoh9Sgl8/La82ZlRb7e+PS5XpEMoXVUA+SBiF3kzgzkaPjlPuj4p6k377CtFZ5xAPFUyGxVbO1CHt4DqW6Bk+Z3CiJUWr/J9hy1/TByoPcRwkcPLoDyE7xY94EY/1xV1A/ahKOfGVf+Ftv2/BWWGKLhdeb+ehQxdHiVxdF/QuUqoWXmPw5Qs+216wuq01ZGnll6zELV3SW9mt3HFIk5KD/z+w+yXq9UIZCvARxgHsFfC16VohRsi9UVurW7jO3l6++A0FvAZDfhNUTOc5EbHBJV7Dgg25wONprc5VzIKkpBkK+Cqf26s8eAX6W9DbCZOTiUB/UXJib96lb112fLGagdVzvNyfoM5AyghYIRcksPFT8Nyz4F8LO1+ivBKOulq6tzwFIGUzZuWPpwAgq0Ln4aTjMZXewwILWFPPdJDZoWl2QLKtmtqVwgqmT1bXhjBZLBVhlPrI8h4/4BBTnCZnJvchUcWWFReMdMe12noAvZBctqvkNmw8FowTDHZ7w0mm+vltiHGkAv861NnTyYy+zmXEimfRaJKOZNQwnOqF9aO6SA5S0w6crNGCxIAmGz85O20GnTB8Fuf5SDI9xa0rHZ7kQeRpc8pdHE5vAR2 G/xAm8sy J3TGLRq99pYboRaK+E5KG1kReLwcdyjjexbs3LdxQUDL7ewQ/Z3yKEm0uJEl7Ez1Fa+513cfbubQQCb6nw16l64enNlWauHNLROxcg5SIkjeohjbFWyUcDB2hZPuDt14zlsveXQZGQ+JLO3TB7NEc4RydMMcdtu2nankW5loYTjVoSPlxauvvWB7Zt4xoVKgy6mrWpxpLstp0FzMvzeG4WAqoMZmHKWbk/4A2kCdmIJVs8RCjyom1CXUHWql2m6XjgxzFcZrST1tnWVDcoEI97xu090f6nK+a8nbgagwUFlEQYcM= 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: List-Subscribe: List-Unsubscribe: On Mon, Aug 26, 2024 at 09:58:08PM GMT, Michal Hocko wrote: > On Mon 26-08-24 15:39:47, Kent Overstreet wrote: > > On Mon, Aug 26, 2024 at 10:47:12AM GMT, Michal Hocko wrote: > > > From: Michal Hocko > > > > > > bch2_new_inode relies on PF_MEMALLOC_NORECLAIM to try to allocate a new > > > inode to achieve GFP_NOWAIT semantic while holding locks. If this > > > allocation fails it will drop locks and use GFP_NOFS allocation context. > > > > > > We would like to drop PF_MEMALLOC_NORECLAIM because it is really > > > dangerous to use if the caller doesn't control the full call chain with > > > this flag set. E.g. if any of the function down the chain needed > > > GFP_NOFAIL request the PF_MEMALLOC_NORECLAIM would override this and > > > cause unexpected failure. > > > > > > While this is not the case in this particular case using the scoped gfp > > > semantic is not really needed bacause we can easily pus the allocation > > > context down the chain without too much clutter. > > > > yeah, eesh, nack. > > Sure, you can NAK this but then deal with the lack of the PF flag by > other means. We have made it clear that PF_MEMALLOC_NORECLAIM is not we > are going to support at the MM level. > > I have done your homework and shown that it is really easy > to use gfp flags directly. The net result is passing gfp flag down to > two functions. Sure part of it is ugglier by having several different > callbacks implementing it but still manageable. Without too much churn. > > So do whatever you like in the bcache code but do not rely on something > that is unsupported by the MM layer which you have sneaked in without an > agreement. Michal, you're being damned hostile, while posting code you haven't even tried to compile. Seriously, dude? How about sticking to the technical issues at hand instead of saying "this is mm, so my way or the highway?". We're all kernel developers here, this is not what we do.