Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2015548rdb; Sun, 4 Feb 2024 10:51:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnUZLy6j8Wg4pbaLqZ2dpvvWE1C0ljuBMZZJgwY7EvpQyyvIbPwMHai8fYM1Wy4TGxkZXW X-Received: by 2002:a05:620a:2289:b0:783:e064:15c2 with SMTP id o9-20020a05620a228900b00783e06415c2mr11981464qkh.29.1707072685562; Sun, 04 Feb 2024 10:51:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707072685; cv=pass; d=google.com; s=arc-20160816; b=SJravIhzklGwKnWeeMU2LOXK18cP8LftPLNZkDEq8+OM1zy3zRJjzaHHyHP1VIdgvF AVJIlejOVNi7gLFPNMQygCoDReKgEhQdyr0ACTa7H0H2IfDh7xpRiJrnbQ9ksLp+Bsk5 2vJkHEQA2qxAMl/QN2FwnN+FU69eNNY5uIwe5GKoaZPp6uj2ZpUW5aC2Yab+QFLy8iy7 D2yaRBVrm3iMzSnQs+C8EFqZHb30h7J+q13gz+xyL3fpgIBHCBYEHlQdb3EsdCY/OcTz mDFyi5ief2S44T+cGe0zjb2F1x+kdIlCXmDZYqQdr722tKQ7Eni3Kr2xDe4P6jy6QgC1 vinA== 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; bh=h8i0ZBrZe7lVtRp0IwzilVeBlhhqzKAVTmt6f/Jrtzs=; fh=NVTMNbjdABnM2V3kelLCwT9fqkpOWzbPg9gObT9AlVY=; b=B7nhiefiya1vcCaF9IIsWbQfwNQcIBv4HKtKLsDvp3xcuX9QM24fR1Q58myvmCZuhd QemfPmdMwgqk36ffB9Hua61AC9O28NFFtS/8/qZv1t/aVrCfyYIxkKw9W+dM57fC/iK7 NevekwXJ904RLb4DTw9ahPq7c7IhJiXWYJUqvmCHuUBDT76WZ82zx73xmSTlVz3Jn5Sq xvN/GMK5m4FKWAxO6iAce9vx6A+53rClem4tML1boPBDpnfg/wglZz7sNj5uV+UOYV7q G/vrhW20ZmkqnBk0v305qELFqTPE1QsolFtf06WgIFvAp3wf7ZYMMvEMon6Hz0U6zup0 ayAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uUrPYftC; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-51848-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51848-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCW+yVjOfmwHGG1WUqUxEXSyLEIe+Nwe7dF2fDR/iYwv4uXlB5ZeGBsZe57QB7LXahSM9cfTpDUZ2gr3JXYNsaj9GpjomUYIDKgbFH2EVA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id oo24-20020a05620a531800b007856325a291si3734627qkn.714.2024.02.04.10.51.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 10:51:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51848-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uUrPYftC; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-51848-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51848-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2A9761C21E5C for ; Sun, 4 Feb 2024 18:51:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9FFF24B52; Sun, 4 Feb 2024 18:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uUrPYftC" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 906FF249FA; Sun, 4 Feb 2024 18:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707072674; cv=none; b=lpqQmKVsAGbaVSNjmt3uPLWEA1B9WEHNQEpNvugXuHv2aTeBPtn6fikLGSuhK5wnVg03jAz1Ss0okWK64kjzcLoLWs+0qtuITG6cW08KvwcidftCnumHxRFoMT1kLCXSMc1Jkf/7tCbbS/Z6zhArCsjeBqw0zPvTiCL2gi8Oz7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707072674; c=relaxed/simple; bh=rZwhviKeGpwY52zfMS1cJH4b/Ftak5t0AXIDWc316yA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KKUZVDvLCpFGoU2m+d0e2ezS49Oewo6uiCIwJ9GSDhF2eGwLLD1x3iV2OOj8vNJm5A2To7XW1NskaLwZjGA5okh+Bs59Sv+ARJ4oeUEOn2qqgRCOXRoy1rHzsizRcyKK5GWQFr5WY0WhxRBrmdBFi12QakO4UMtum3fODFwPb2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=uUrPYftC; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=h8i0ZBrZe7lVtRp0IwzilVeBlhhqzKAVTmt6f/Jrtzs=; b=uUrPYftC8Xnn9WGjYChRzGUuEB kaw+oQCk3iBTYwSUrRuGD0t1kfeFVj5/SxpRMcX2BrdG41h/3pqXDsPE48SgECjPyTw+1Yk436lax DdRAurDfdvkhwhDeGWztKDk+fqbVuo4RMpwCs7qrqH4Bu+nUtxcsOpmVEz7Z0MphzdZTntNwsSY93 V4HDIjOXR0VLpjFkcHBJ3NHtF4XyvoQKjtZI9nTg0gD38j2fWyqEH6N0x56S5XWyyyVeYIEDoaejp +eBMQ2cpLIEyWcIHSN+aK9CM7+wPZaOT4JjrRE0tuzwg1dl2aO0q4z8HCL6ghOo4WS3kT4YCW0TmN l0PjK0IQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWha5-00000007KJG-2Fgk; Sun, 04 Feb 2024 18:51:05 +0000 Date: Sun, 4 Feb 2024 18:51:05 +0000 From: Matthew Wilcox To: Qi Zheng Cc: akpm@linux-foundation.org, arnd@arndb.de, muchun.song@linux.dev, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 1/2] mm: pgtable: add missing flag and statistics for kernel PTE page Message-ID: References: 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 Content-Disposition: inline In-Reply-To: On Thu, Feb 01, 2024 at 04:05:40PM +0800, Qi Zheng wrote: > For kernel PTE page, we do not need to allocate and initialize its split > ptlock, but as a page table page, it's still necessary to add PG_table > flag and NR_PAGETABLE statistics for it. No, this is wrong. We do not account _kernel_ page tables to the _user_. Just because the kernel, say, called vmalloc() doesn't mean we should charge the task for it. Moreover, one task may call vmalloc() and a different task would then call vfree(). This is a can of worms you don't want to open. Why did you want to do this?