Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp303887lqp; Mon, 10 Jun 2024 05:00:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiAddkg4uppLMEW47EAn6t4q8oWgNMVCrflIZW6C0BaN6AtsCP5iDVmmz5DXFdEARZP0wc6ZqdUhNjRtXh5krdzouftMjLHWuOg36Gdw== X-Google-Smtp-Source: AGHT+IHtTdPh4TUiNcGVvyHc3s1D/B4Sqdjwd88R1kbor6K+21NMOGRdPCQakKh6s2mHiaShq5gD X-Received: by 2002:a50:8d1e:0:b0:57c:74b1:bf51 with SMTP id 4fb4d7f45d1cf-57c74b1bfb2mr3621986a12.20.1718020833036; Mon, 10 Jun 2024 05:00:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718020833; cv=pass; d=google.com; s=arc-20160816; b=gDM4r/En58P/WDezYbQUwzUVJxkBnEw5/nr4W7BQEIHB0EoumGmcUqw4m94P5UYynT F2UnjKCWjVhbSd9E5EomxJI6z5k4WEPyK7vulCsuIAdtNzS0ZLEa/DSl1uypZ2LVCStq Q6OPvhOHkm4aJB1NqIN6G0ER6LJpLrgPpwJsqJfI97DzzsnkWCmDgvqeCMRBFlvuW9/e E5+jqVwcqA81eTzVgqc/nZxDJWRs6MaH8TMm890l4tJl0Zn+fWLQi+Z0taSldGu65ZLA l1HDU2JVDi/aMOvlC2wrjMke5YpdF+vncK+jdveFWKLjuvs9z9pS1/EDi8eNy6izia3q 6Thg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=8a0YO74G5ZN6eUsTagdB66KLLDnxZNwj4Mba32IuxoE=; fh=AHXReiFY4KE89cgYGjLcTvvhuVrGH8h0XX3jgFFC0RE=; b=paWjDJOorcuQEfTA80UwgxyBLFQCcF0ggsmk6uZMGTsL7o0/Kmb6rhIwW2MDURP5hO grOc5VOvs1lrEPF4JVsD1XMShZZx/IIi6NJU3o1YCu/IbQVO/57v1VF4E2R+Mf4/vITG NR2mUn33o7ax1B25wJ9d3lXv5rs8UPTbIFxK8wC6eB7hOl7lfYW2DfGa2OUMFaxNv2gO 5VnzlWQQIVkPH0zl5fZUKckIIAKlRtn7dF3q+klhho+4Bg72kwIbSTFWsuOyk5eCvrly wc/mHeDuI4Lm5ckYcAfv4mX5gzmZEitbQBIUAU6C3gZ+RDAxT6cYR5EJU5koicacnJet NfgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Wnz26ipn; dkim=pass header.i=@suse.com header.s=susede1 header.b=Wnz26ipn; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-crypto+bounces-4858-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4858-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c70b6c05bsi2186108a12.43.2024.06.10.05.00.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 05:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4858-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Wnz26ipn; dkim=pass header.i=@suse.com header.s=susede1 header.b=Wnz26ipn; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-crypto+bounces-4858-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4858-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 900441F232F8 for ; Mon, 10 Jun 2024 12:00:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F7E6502B1; Mon, 10 Jun 2024 12:00:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Wnz26ipn"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Wnz26ipn" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B9961F171; Mon, 10 Jun 2024 12:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718020829; cv=none; b=lf72g5Azr7ED5tKEYfRuK3/6jj6DTuLuMQIW+BL76CFnTtx7a6uZTrr2SisYCYjEy++vjRmbrW+DM6Zeqnxa90l2s6Lz5aPAVn6lQe74Xu8uYoe8IrC0+g6EwWb5sjFpJW0eT52WrbnzTMCw6t8YGMIH0FvUuBCFTgyPHxIGdto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718020829; c=relaxed/simple; bh=acUR3zUJwolkHUEToKVKtJFNeC9oRwyTpo2IsGwK7Hw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KYlUgTSfGLRIzqG8vZGBGAQ2FYKuVmG2XEY046+MvIKke505FxO0Np/WuqTGGIN4DZ8wAVdH/qt5bu97dcHw6WfwnELb9+uuH4t+sWcqeoe+Uk2k7ogHzQ+7nQdjqR3XzmNMyQ1ADuHDgK9HbHphz2Kh1rqKVb3VMuFOouFZSCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=Wnz26ipn; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=Wnz26ipn; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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= Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=Wnz26ipn 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> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Flag: NO X-Spam-Score: -4.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 51A411F7F0 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MISSING_XM_UA(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_TWELVE(0.00)[16]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+] 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