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 323C3C48BF6 for ; Mon, 4 Mar 2024 00:35:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9ECC96B0098; Sun, 3 Mar 2024 19:35:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 99CD36B009C; Sun, 3 Mar 2024 19:35:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8645B6B009D; Sun, 3 Mar 2024 19:35:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 773676B0098 for ; Sun, 3 Mar 2024 19:35:16 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 28DC4A0A32 for ; Mon, 4 Mar 2024 00:35:16 +0000 (UTC) X-FDA: 81857487432.17.A05286E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id 0968240011 for ; Mon, 4 Mar 2024 00:35:12 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EivKppns; dmarc=none; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709512514; 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=zaZmGutyO121MYVQQw/hfLZRSJAhEIRFLCywTeF9lFg=; b=R47C4N4wGFRr9SV0YTwChpN7ncqYa7doBQczhyevVOH8vTPVjOpNM/o5u1fNZ4pgD5Y0En bEnsJO8cVhtanfDrrRJ4wJNeqlGDR8ViKlqAd/ml5pL/BsFd0nU4bApcgFyPtsY5/Ruv5/ LQGkN4NXEzmkI7ZVE8W+BCIdk5pjuTs= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EivKppns; dmarc=none; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709512514; a=rsa-sha256; cv=none; b=Gzi0iFuRpqwgeJxC/yqkimkw94/b/tZr7tDRggGzC6Elj5jX/IkHHgoUc7LyYyZu/90XBp fk3QuQ1Zj+jb6NXUYRG4yzsVikm/+Io0pM3Golh4LO0PSk1pdvZIA+2Siy7CGtp3bt+3xx ud5KyF8ubSOlzzhcIlHDCCGIeRODZeQ= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zaZmGutyO121MYVQQw/hfLZRSJAhEIRFLCywTeF9lFg=; b=EivKppnsAWxl4MrnKX2BtjzwLj VFHLQG4M9oSpAznJnRkVCFqZbNYbXMELlYpU0Ydi1rFwr8alOj7FD4jYp1DhqA3riXnQwaz5XTYl+ Li1DggJVDIzcvzBHhIU3NUEv9GfYNRSLT3+wxCn2I1YcsnnuheEJfWypgRazZeLcptTNYBT7Pt5mQ 1F5rOCvVME6wV7GKhCG8/7CvKntNpkg8TG/NvqyzwFfOIs6j3Xxirr4aW+GeSDkNu6OzZzl8rSXlY N7ey3tlYQoQoAItzWFdlc+//CXsuguGf9lmr3aTu0nrLOArFIIt4nvujR+T4HluLN20lK+jnvo9sm XZx+t+pw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rgwIL-000000003UI-1QdC; Mon, 04 Mar 2024 00:35:05 +0000 Date: Mon, 4 Mar 2024 00:35:05 +0000 From: Matthew Wilcox To: NeilBrown Cc: Kent Overstreet , Dave Chinner , Amir Goldstein , paulmck@kernel.org, lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel , Jan Kara Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] Reclamation interactions with RCU Message-ID: References: <170925937840.24797.2167230750547152404@noble.neil.brown.name> <170933687972.24797.18406852925615624495@noble.neil.brown.name> <170950594802.24797.17587526251920021411@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170950594802.24797.17587526251920021411@noble.neil.brown.name> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0968240011 X-Stat-Signature: td8twuq9ai5d5zods8n86kwjhw4j4nd1 X-Rspam-User: X-HE-Tag: 1709512512-110267 X-HE-Meta: U2FsdGVkX195rABM+I5nZeHj9widnfXb6MInbpO2tzP/gBgQEaDubemf0NqjwbZNClIfox0EkRsFTECse1ZchXxH3fpB4pgrZ++27vGZhWsxmwMmjDx4v4QVvqUkU7dDnjgs6xJmlN15bCSd4GpvC3sF6Kb9ExPNHmE+DYvgUp0XiJNv1wU25ioU4c00T5UDLZxlF/MdZOuV1DMjWii1O8ndE6NhZVb8JNunJyWPwMDW8rYi79u4bPGy7f5wqKmv0vNcP2GFMvqYj23Em4Mii0l3/uKtpsNjkeoGbHcD0EHmHl2iIFNqMvtOYSCQhMkyhTy5bLuRCwsAW15Iezny/FySkWxHlQ6CaX3lVdiRtL+UT+MmZHxtX0zyxdN0GYWN5yaM8QffRGSXVGqtOPQqFzwIaphjTaiQ8QLirBOhm6BrW+40XnjF5DDriO363ToJRJvgptNqXMiOO4/uOV4jHSsejbzdrJc1yMw+/tL+T9vhemGDL9M8FOxZckbHkQnj72qE4IFtAtzBeiNCwyzY57HC3lOPMzMNLN9W0E8opWyOdtB5q10WBK46lmW2JUkxSpzbAMMNsnDMWtYd1vyD+6p08WBpYaFBkty99bkiaYlb1Y4zXVfgTewH3upVCRuRZ5CX5xDqK7+15OmQZXdUki71m1vuXLBS+MfwDGmoJvD+FdJms/9nlmG74PUJj57rNNdbbp5mfggWv0+/e2RUIkvQXxhtja5J9+7fKTT+S2uhmjEViUUV+dU1HD8THHMW6KUjCbev0bj5x8vD2Mov0s3xiic6qwhAjxPaTLJb9qkGE92Kopdpu5uFclz0r9ppgbxI51xwoz8iYq93rsEm/A== 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, Mar 04, 2024 at 09:45:48AM +1100, NeilBrown wrote: > I have in mind a more explicit statement of how much waiting is > acceptable. > > GFP_NOFAIL - wait indefinitely > GFP_KILLABLE - wait indefinitely unless fatal signal is pending. > GFP_RETRY - may retry but deadlock, though unlikely, is possible. So > don't wait indefinitely. May abort more quickly if fatal > signal is pending. > GFP_NO_RETRY - only try things once. This may sleep, but will give up > fairly quickly. Either deadlock is a significant > possibility, or alternate strategy is fairly cheap. > GFP_ATOMIC - don't sleep - same as current. I don't think these should be GFP flags. Rather, these should be context flags (and indeed, they're mutually exclusive, so this is a small integer to represent where we are on the spectrum). That is we want code to do void *alloc_foo(void) { return init_foo(kmalloc(256, GFP_MOVABLE)); } void submit_foo(void) { spin_lock(&submit_lock); flags = memalloc_set_atomic(); __submit_foo(alloc_foo()); memalloc_restore_flags(flags); spin_unlock(&submit_lock); } struct foo *prealloc_foo(void) { return alloc_foo(); } ... for various degrees of complexity. That is, the _location_ of memory is allocation site knowledge, but how hard to try is _path_ dependent, and not known at the allocation site because it doesn't know what locks are held.