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 40C17C27C55 for ; Mon, 10 Jun 2024 12:00:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 842B26B0088; Mon, 10 Jun 2024 08:00:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F1A76B0089; Mon, 10 Jun 2024 08:00:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B91F6B008C; Mon, 10 Jun 2024 08:00:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4F8766B0088 for ; Mon, 10 Jun 2024 08:00:31 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B73171A0F6A for ; Mon, 10 Jun 2024 12:00:30 +0000 (UTC) X-FDA: 82214836620.24.E2227E5 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf17.hostedemail.com (Postfix) with ESMTP id 2413C40026 for ; Mon, 10 Jun 2024 12:00:27 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Wnz26ipn; dkim=pass header.d=suse.com header.s=susede1 header.b=Wnz26ipn; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf17.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718020828; 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=8a0YO74G5ZN6eUsTagdB66KLLDnxZNwj4Mba32IuxoE=; b=8W6Xp3sj9Po1bSPuTcwbV/9Mg1UW+sXW6Lp3lIY1onjctat/yA5cVSPDSSCfGy3T3fmfqU Wvj7Ky7yiYiyAeeR4t6mf6+b3LYGDd2WrC+eh9ru132usbLD7qmJ8y2DcwwwpA+YtXubFw nCaG2//2O0goq25gFMq+Kx7cWQ8siFU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718020828; a=rsa-sha256; cv=none; b=2d27xHR82yJWUMtishCe4+NsbReNN3NRFUg2L0lzMFldoy9nWteRZzSXIBdn2WQWdRZdzU HoXyr5J0imQo1KmCXsIZSRgU9Sx1EsiIM1YhwP4EDZYZ7j6X3yTBbAN0ug5MN36KBytP2R mrlsY/E0+MIdU3oeMWAAJXNTa1Gi7eU= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Wnz26ipn; dkim=pass header.d=suse.com header.s=susede1 header.b=Wnz26ipn; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf17.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 51A411F7F0; Mon, 10 Jun 2024 12:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718020826; h=from:from:reply-to: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=8a0YO74G5ZN6eUsTagdB66KLLDnxZNwj4Mba32IuxoE=; b=Wnz26ipn69xTzQFmPeEPoPPT/LMjAAyDQB0T1j6WPf4TE5WsHZmWjg13mUi4LMriSZGOWF ej+OP9Van/MA3afU3UV0ZL+32iv+dE6eV9FAl/zouKoafQNMM3Y28gyC3feWC5wiGh9wQX 8DvTmh5Wbo/GaJ0/Tl/D3qzljrlX0bQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718020826; h=from:from:reply-to: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=8a0YO74G5ZN6eUsTagdB66KLLDnxZNwj4Mba32IuxoE=; b=Wnz26ipn69xTzQFmPeEPoPPT/LMjAAyDQB0T1j6WPf4TE5WsHZmWjg13mUi4LMriSZGOWF ej+OP9Van/MA3afU3UV0ZL+32iv+dE6eV9FAl/zouKoafQNMM3Y28gyC3feWC5wiGh9wQX 8DvTmh5Wbo/GaJ0/Tl/D3qzljrlX0bQ= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 325AB13A7F; Mon, 10 Jun 2024 12:00:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 3cJMCdrqZmYEGgAAD6G6ig (envelope-from ); Mon, 10 Jun 2024 12:00:26 +0000 Date: Mon, 10 Jun 2024 14:00:21 +0200 From: Michal Hocko To: Jann Horn Cc: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, patches@lists.linux.dev, tglx@linutronix.de, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Florian Weimer , Arnd Bergmann , Christian Brauner , David Hildenbrand , linux-mm@kvack.org Subject: Re: [PATCH v16 1/5] mm: add VM_DROPPABLE for designating always lazily freeable mappings Message-ID: References: <20240528122352.2485958-1-Jason@zx2c4.com> <20240528122352.2485958-2-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Action: no action X-Stat-Signature: 74xduuob9rc83fxzm5jbbwiu77wzxuod X-Rspamd-Queue-Id: 2413C40026 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1718020827-328863 X-HE-Meta: U2FsdGVkX19PBHxZhmoLwTn/a2Xm7E6kr4fVckCIkM3Lc/mrm2n/43ozTywnUz1hQKUkWs8XEMZGCAvMFrrcfi/jUi1NePFkpy/LJdxLKV8Cx2+mnij1J5EZVXc6pomt7dDDWBuTmXOzGqdoYGoHDIxR3CuBEAUiBv8qmAmQpNXr1yuV7YIfw8YG8BF5OY3xA1SUNgkOdhXk/O6Mdkwp2ESL20D2wQ42Rskf3rd3y+YPIUUew3vru1+kMDc50i+4GFfJn61XsPuiZWnS2k2YmxsT83r7ahvEtz0BEM5wfyBzA4lFfMfjx56M6DdB+JHhUvd54ile7D92T28m9PFi2MUN6BH6X/RbXBhgKx2vTIb9RMPjn5FhX8dPqhvo+ALkL9nSjCChidrT/exN0Jcn4lcBR8fXkUpgJFWiiCmXSkhIgpLIqZuzkurivF4JqkhThHDdJP/ODPUQI7ijlWcJXOLuQ9T4Nj+1cn61P9juKvuHKn+8ytVoaURtLd131+IXBUWCY7TkCtQy1Q8g95ZOSa1rfEVseIcpZVVfJeLlEioA/nmmhQJVjRb5afUIqJEX+Pd8tUIIsnWYA8zZsOsBRRzYWSp95tjozP7v4IQ/1OT6YmXIcnpTDqwWXmtx95G2NFv4HOPh6mUfAj/4Co2THDSQmPUknM7Q7Qf006mcBGgw02CLFusaP9cCNIeTdgsaVNiOTaoX4AuwWySvNpkS/59ERzLOxF3gIwf2YmHsUA1tSyBH2/4OL0MZ/LCf+4Wbs0ViQfuCYwPAEHM0J3tZEahS64yogw1JpD6gBzWKpZXQjDZ2618D6BXP+WaNdGFIwj+AcBZk5StzqWklxiMCiPd0wo2MPsk37z0kOU0WufsUpWMcbfQ9iCoKvaI9onq7N64qqOnP90F5pDZfxylG0qX7oPDqREYyzurUe9UiceJyiMkmC6h+pA9RK2boyN305n+wOUa2U0LayEvoJMe 1msBc1ZE cJBgIQpaq1BKQTGzOgXvzQlnZR1t/VbWorX+7MWlBoSmEDD7YCZMSK9sSFt05diExJp+HhGctI5/iYqXeRx+FwbcdziCW0i6I909Xk5VYRUDjyGA89AicJU/WhVjvfH0rHgv0cMngmfYFI3WBd/jDmfLmfQkfu5pZR6wfSkW+xJiH1NbWa+0duwZ7OICk1zNVh5wRf1SKXenMsL003jXXzjgoOzxDWFQUGiD1/cPo+aTLye/+6OdnpaYyXMhsg4ctxSoa2uiJI0/t/WE= 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 Fri 07-06-24 17:50:34, Jann Horn wrote: [...] > Or, from a different angle: You're trying to allocate memory, and you > can't make forward progress until that memory has been allocated > (unless the process is killed). That's what GFP_KERNEL is for. Stuff > like "__GFP_NOWARN | __GFP_NORETRY" is for when you have a backup plan > that lets you make progress (perhaps in a slightly less efficient way, > or by dropping some incoming data, or something like that), and it > hints to the page allocator that it doesn't have to try hard to > reclaim memory if it can't find free memory quickly. Correct. A psedu-busy wait for allocation to succeed sounds like a very bad idea to imprint into ABI. Is there really any design requirement to make these mappings to never cause the OOM killer? Making the content dropable under memory pressure because it is inherently recoverable is something else (this is essentially an implicit MADV_FREE semantic) but putting a requirement on the memory allocation on the fault sounds just wrong to me. -- Michal Hocko SUSE Labs