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 706BCC3064D for ; Tue, 2 Jul 2024 15:08:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 095916B0093; Tue, 2 Jul 2024 11:08:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01E266B0096; Tue, 2 Jul 2024 11:08:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E28136B0098; Tue, 2 Jul 2024 11:08:48 -0400 (EDT) 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 C477E6B0093 for ; Tue, 2 Jul 2024 11:08:48 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3B4F1A1FE5 for ; Tue, 2 Jul 2024 15:08:46 +0000 (UTC) X-FDA: 82295144652.09.BA06FC7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 1725C1C0002 for ; Tue, 2 Jul 2024 15:08:43 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=JD42hutR; spf=pass (imf18.hostedemail.com: domain of "SRS0=DpDH=OC=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=DpDH=OC=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=quarantine) header.from=zx2c4.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719932894; 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=vn+Q8NW4bbMGozhTyvScvIPS122WxS7dCXcrNrQNePA=; b=eldbRj7Gn9UL59F5KFTTagWLOG7l5bjhm2tolrd4NM7Zw0+9UCrxZd7ofbIEU8utOb9uOV Mj7g6w4N//uoV+L4wvrDkCUPxq0FdEHlPdM5GI2QKRCrHsKnPOA0kdKrbTZDMMJUH615ds 6uVWgWyOxhtltRKkWxvpt3wB9QmZh0I= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=JD42hutR; spf=pass (imf18.hostedemail.com: domain of "SRS0=DpDH=OC=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=DpDH=OC=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=quarantine) header.from=zx2c4.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719932894; a=rsa-sha256; cv=none; b=dbFrhpsOu/XgLYd+toirMvvYHEkDNJNT8xHNDav4LpuLCw0GkHP/KF9cUTaxY/vRDgYd+2 OxDgZyJGd1t5GJcLv1/Mhkjtrre0keA7xGxjxgQUci3OMID1evmahZfC08jOUk9wvKBLHt ZVdBujp4KZgYo9itf721dl4MhMfhWoE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D411D61DD9; Tue, 2 Jul 2024 15:08:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C49C116B1; Tue, 2 Jul 2024 15:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1719932919; 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=vn+Q8NW4bbMGozhTyvScvIPS122WxS7dCXcrNrQNePA=; b=JD42hutR8R9eR9bl8Mk9GlUUg7WChrnYNR0XMRMyM5jMhIXnhl7DWdPNmEvbXrCX9i+vDC PmuqcG+oBdx+PogQ+NgfsDLGKhSbnkXlG43fhSEoEglUgS/0rRzPwrMoOzTTQp19JTTK1b gFb9GX3U+wwhcbEKl/8tXeob2erGp1c= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 6661eee5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 2 Jul 2024 15:08:37 +0000 (UTC) Date: Tue, 2 Jul 2024 17:08:34 +0200 From: "Jason A. Donenfeld" To: Andrew Morton Cc: 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 , Jann Horn , Christian Brauner , David Hildenbrand , linux-mm@kvack.org Subject: Re: [PATCH v19 1/5] mm: add VM_DROPPABLE for designating always lazily freeable mappings Message-ID: References: <20240701135801.3698-1-Jason@zx2c4.com> <20240701135801.3698-2-Jason@zx2c4.com> <20240702004254.3ab2db4a98cb7fdd245407cb@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240702004254.3ab2db4a98cb7fdd245407cb@linux-foundation.org> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1725C1C0002 X-Stat-Signature: q9ayap5ixcm344kubp5n5tx1ytou5xx7 X-Rspam-User: X-HE-Tag: 1719932923-905435 X-HE-Meta: U2FsdGVkX18zQ2ShlKHecJZka8rorUh4bA62iuJfjXPPWO+gEdgdJN6h0JfTOdyt0D1cVGKAUBi/3MBffbHCaw8o7KvjrGeyQFHBYdVbQ2/rLO3XQLP8Tnj3L6JGoFpnJ9hiWm3o/n22hiyAteMDGAC4mK1Yrgv2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8jTzrlskogU3Sx6ovHvrfXG798yy31U3FvkckFNTjtX6yTJuQ3iASoiaBGfJI3hDRB9zegkyxd4kXNWSQNlq8ytKE7kEaOjAQmx+WCpr3riRRxEGz76r3HPgHcnhQhtls11x0ljqOZtWbfpkaJ+fxS3Y6a4x7uoSa8AkyyBZsG/DM503qNVomJ0FiwGBbHjGuNqCU06APom10pQhDS1h6jMzB1OAB4n9Txm6La7z1tfOWfkGZPBlI 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: Hey Andrew, On Tue, Jul 02, 2024 at 12:42:54AM -0700, Andrew Morton wrote: > The patch is impressively comment-free. It is a little harsh to make > readers go poking around in the git history to figure out what > VM_DROPPABLE is, and why it exists. Sure, I'll add some comments to the conditionals added to make it more clear. > Seems hard to test that this mode is working correctly. Can you think > of a way for userspace to check this? And if so, add it to selftests? I've got a pretty straight forward test I've been using during my own testing that I can add to the vgetrandom_alloc() selftest (which exposes these code paths). It works fairly reliably. Basically, one process keeps checking to see if the memory has been dropped, while the other consumes memory a page at a time. Pretty soon (depending on how much ram you have), the memory gets dropped, and this is detected, and the test completes with a pass. I'll have this in v+1 of this series. Jason