From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gentwo.org (gentwo.org [62.72.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4D261DD520 for ; Wed, 15 Jan 2025 22:30:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.72.0.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736980226; cv=none; b=gAmWrcBthTQrFm/r3aeL5kJ/QUq4FUimsfsFJvFdhRFgqgW8eFin2cFmgOgJr0w7ckFxnu/oC3YCEXe2qQmvA33CHdXghmFoeNXhzaehTGuIAnY3SO+b+Jcj+F4yjkZ1L6zeD4Ry0QhPUhzkfLQ9m45a9qgaRvfEZcuqHUo90c4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736980226; c=relaxed/simple; bh=/4Xf8buKBR2VGSEJmQ+Ry9mULzWt1h6uiBrIfBq2y00=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=RZQf/blKPMAgHIRG+FUi2/gTkK1arnornQp/hYLAdFbZqVOEPYck9NgOmSMg/WmvqEpX6AvxhXlYGHwRTe4ex7zOsmdH6/cJrDZuTcQdWSFP4lVn3o8qSdyio9rxRPCKzcyexTvgh3eUpd5Vh1xS+s/vo2gT9LYrVmCyjBN6Hkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gentwo.org; spf=pass smtp.mailfrom=gentwo.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b=jBpqla/q; arc=none smtp.client-ip=62.72.0.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gentwo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentwo.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b="jBpqla/q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.org; s=default; t=1736978742; bh=/4Xf8buKBR2VGSEJmQ+Ry9mULzWt1h6uiBrIfBq2y00=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=jBpqla/qYb4s6u/jSGkqNWYrtI9cx685hoga6h4EVP1wfhnWR8xPZ79QQdwpgQvUg texAlaH+Y/phdxq8hqNd9jgNEAvUE0ppoY+9+884Y2kCFhgxvOUgV1W70dGder70yH 3CjQ+oDqp/s+gWJ3/RwKM4/BCtcEBO3N5bK3oYeU= Received: by gentwo.org (Postfix, from userid 1003) id AFE4A40449; Wed, 15 Jan 2025 14:05:42 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id A97AB401D1; Wed, 15 Jan 2025 14:05:42 -0800 (PST) Date: Wed, 15 Jan 2025 14:05:42 -0800 (PST) From: "Christoph Lameter (Ampere)" To: Yang Shi cc: Lorenzo Stoakes , arnd@arndb.de, gregkh@linuxfoundation.org, Liam.Howlett@oracle.com, vbabka@suse.cz, jannh@google.com, willy@infradead.org, liushixin2@huawei.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] /dev/zero: make private mapping full anonymous mapping In-Reply-To: <0c7fb1b2-4f08-4017-a27c-cc0cb4da4a93@os.amperecomputing.com> Message-ID: References: <20250113223033.4054534-1-yang@os.amperecomputing.com> <2dda50aa-e4a1-4664-b8fa-56ba975db329@lucifer.local> <65691afc-615a-4716-8a2e-1f43bc65111c@os.amperecomputing.com> <3fdcd6a5-27fe-411b-923c-b7410e4cbda9@lucifer.local> <389c72c2-f102-4d32-886b-99d7c212a295@os.amperecomputing.com> <23f50178-59d1-462b-8463-48cc707d6b3f@os.amperecomputing.com> <0c7fb1b2-4f08-4017-a27c-cc0cb4da4a93@os.amperecomputing.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Wed, 15 Jan 2025, Yang Shi wrote: > > > > I just thought of named anonymous VMA may help. We can give the private > > > /dev/zero mapping a name, for example, just "/dev/zero". However, > > > "[anon:/dev/zero]" will show up in smaps/maps. We can't keep the device > > > numbers and inode number either, but it seems it can tell the user this > > > mapping comes from /dev/zero, and it also explicitly tells us it is > > > specially treated by kernel. Hopefully setting anon_name is permitted. > > But then that'd require CONFIG_ANON_VMA_NAME unfortunately :( > > Yes. Add a counter for NULL pages in smaps? I.e. Null: 4 kB Both anonymous and file mappings could have NULL page references right?