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 6A89EC3DA6E for ; Fri, 5 Jan 2024 14:35:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BEA118D0018; Fri, 5 Jan 2024 09:35:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B9A3E6B0188; Fri, 5 Jan 2024 09:35:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A894B8D0018; Fri, 5 Jan 2024 09:35:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9775D6B0186 for ; Fri, 5 Jan 2024 09:35:53 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6E72140A7E for ; Fri, 5 Jan 2024 14:35:53 +0000 (UTC) X-FDA: 81645506586.03.4053363 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id AD785C0009 for ; Fri, 5 Jan 2024 14:35:51 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bI0he0u8; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of vbabka@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=vbabka@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704465351; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EygD9BrtTMk3m1iWzpBiAzepmtQ8ztbZrT64ylgef6I=; b=53frKlf2i6/TuHs0krvlEu9BRItOrYrdvJpmrtmUcIK/BJgyU4mbWT0Vt5D7YuVjwNF/5V j0OTWKkv1H3naGx5ztA+yCCQCESoL7gKxmELWxHH6k7wauihmL6j3/EGJYIPwvML4rMUHL cXy1bDygPu4boKNyDribuvoweSx53F8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bI0he0u8; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of vbabka@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=vbabka@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704465351; a=rsa-sha256; cv=none; b=rO/AGN0SkZUqNo+/T0tBRb07B8SD17ym18ylMh9QedUbw8VqoYYCwPgRox+PDA2FOa1x1a Y6mJxtW9UMjm2eZjTWZpTdq+IvnJfgJzH3WwlKCqnFl3/Z4P3W3kY6QDolRYR9NIkLHiQr 8FHPLMT50ANH7Ox/Ph2OnsQNcpQEFS0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8C00A61B33; Fri, 5 Jan 2024 14:35:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 615E9C433C7; Fri, 5 Jan 2024 14:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704465350; bh=ka/VGduA+g6Ty/g3PfHmE31VPABF7sH+61l2Ri2RP4o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bI0he0u8LKjbDenWOurPtUTqPAzUOVcvLAiYQsGGX90tL1LB0LDVS7AldIDXfwAc5 7U3D8ZlRMEJuCNyxzjngrw38wEr5a/RJNRnDNjK/FiJUoYDwxYRFfCUUf/FWho3Gb9 byllmAj9Ne3+l4ZJew0i2E2Ys01gyRewS0x3jK/FOxrGdSyM8GdaDDFTXMyV6ogJok xx59KLJkZGFiduu/qBxu5lpsDYmWpWAaoi50CRZZXKWzDwXK1pXFNC5PulrGfhmkR3 hbkCXdBCwNkGyNpL6hPhpw2prTOAJjXPpxhp06Vuo6kLceMRmEfXjF0bCXtxbgghQL 6HSg2DNX3ux7w== Message-ID: <4101c577-91f9-40c2-9244-5a08dec4523a@kernel.org> Date: Fri, 5 Jan 2024 15:35:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [LSF/MM/BPF TOPIC] Removing GFP_NOFS Content-Language: en-US To: Viacheslav Dubeyko , Matthew Wilcox Cc: lsf-pc@lists.linux-foundation.org, Linux FS Devel , linux-mm@kvack.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org References: <2EEB5F76-1D68-4B17-82B6-4A459D91E4BF@dubeyko.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: <2EEB5F76-1D68-4B17-82B6-4A459D91E4BF@dubeyko.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AD785C0009 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: x9xfm763g8p18q33e1sntsq9oo5xgjdg X-HE-Tag: 1704465351-489193 X-HE-Meta: U2FsdGVkX19iD4hnoDLy90kGOrUpruxVr18bStQ9T+IoQiuMtQdTeWKkAL8d1Jp3ydEwnCtI+vykTzyVrM06ABhBpYg853fRjbbQy9G2xPxWNaTOQ4quZsL7rd7WKgpJ2u+C623nV+rEBAoi6IyZPbJjt3mgq7hCZK7ICJsvoReBDAqSBcuL6cB8kkRyRwI1QG+bJ/3nLGNjHraka+ObkbKD1mxdILHQ3w3YX1neQheg+mBXU79dCws+3DMmIFVTMgdiggwCyPwzVD2LHglhWeq2g+cu3q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: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 1/5/24 11:13, Viacheslav Dubeyko wrote: > >> On Jan 5, 2024, at 12:17 AM, Matthew Wilcox wrote: >> >> The memalloc_nofs APIs were introduced in May 2017, but we still have >> over 1000 uses of GFP_NOFS in fs/ today (and 200 outside fs/, which is >> really sad). This session is for filesystem developers to talk about >> what they need to do to fix up their own filesystem, or share stories >> about how they made their filesystem better by adopting the new APIs. >> > > Many file systems are still heavily using GFP_NOFS for kmalloc and > kmem_cache_alloc family methods even if memalloc_nofs_save() and > memalloc_nofs_restore() pair is used too. But I can see that GFP_NOFS Yes it should be enough to rely on memalloc_nofs_save() for kmalloc/kmem_cache_alloc. The kmalloc layer doesnt't care about it, and once it's run out of available slab folios and calls into the page allocator for a new one, it evaluates the effect of memalloc_nofs_save() as expected. > is used in radix_tree_preload(), bio_alloc(), posix_acl_clone(), > sb_issue_zeroout, sb_issue_discard(), alloc_inode_sb(), blkdev_issue_zeroout(), > blkdev_issue_secure_erase(), blkdev_zone_mgmt(), etc. > > Would it be safe to switch on memalloc_nofs_save()/memalloc_nofs_restore() for > all possible cases? Any potential issues or downsides? > > Thanks, > Slava. > >