Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1958428rdb; Sun, 4 Feb 2024 08:27:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrDl0WmRFRXRlfZbvWlpofFxhj7/Ya7SHMmTip3CRKkIJ/AX36sHOZQkmYi2WUhp43PDvR X-Received: by 2002:a17:907:7748:b0:a35:6669:9fe with SMTP id kx8-20020a170907774800b00a35666909femr3114879ejc.32.1707064021334; Sun, 04 Feb 2024 08:27:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707064021; cv=pass; d=google.com; s=arc-20160816; b=juLvwFQTdiERwm3BPGso2J2U33w2Nz+wY6w28jph26/awqJenybgiK73rA8IsFzXum iWv8NBAQs8Gn04kYWLj5vE5UnCTdAEMiKDukyG1zuRCmliE8kyneXQOrdtQ1SyjCA3pb O2PUOhGaLbrQ2UmblSiAVRhpkhzs1qYsdgXiBEY7f5bsoUnqmul6L0W5lWMY2mYa5Moj Y4L7MyZvFFykz9RRQ8Wv3QeMIL5Jp3eCaGBKZxITft1rT0C4JUJO/ptf7W+3H+rUSbT3 ZeqylFSHc47Nx5cbiPnwIZ8Bc4cuLwnq4mhRVcNFqqF1Cujoqw72WYwK95K9GCUrc1/z 5aEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4QsMafIxNnK2tT3E+d+X68HEoyZ0oqU7kYpJhvEviWU=; fh=eEija6QNH0kkQS8VjJ4zXIE+ky0avqZdKagYCIKCGww=; b=LUI9ixnrJTbjpW5Pmb2vcZ0c4YQw1tZ5KGU88r7k6lxY8JUQS1f7XfkHoe28/q3jX7 /JKpmVZ06dUK3PL40jqJg4RwFbiBzW9SRolkFuPtgKjlrSErOWf0pePAJACU2VN+A+8v 6Bl5ap4AwmdEwEr3gnxJyyrX6W7arYCGhSEpFTtWke4G665QPZ1rYDcib+QtScho4GAj gseNV4Ra9z8Oo//OUa1E+2AnJt0m9pxEjw2Qga5ChsjBBCgEEimgUJfmDdu6cCxLmemI 9Qy6y3/i982RrQrJ8QFJHSJOzg3FYhx1RpYyF8MsolZd1l9HrQJxoJyzkagA53DCvLrZ hSyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=D9SAOIZL; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-51784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com X-Forwarded-Encrypted: i=1; AJvYcCUwBTg34azh/vs7UMVMrlngbvTtaRaA6KRvHqRLYf4cV+0wqatxyG17zyGzTjzEDQbOH22asJ4kEzxNH8Ou2mYkUNi2QUy/6+rZN3U57g== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id uz29-20020a170907119d00b00a35e84b0bffsi3040129ejb.764.2024.02.04.08.27.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:27:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=D9SAOIZL; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-51784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.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 99D1A1F2145D for ; Sun, 4 Feb 2024 16:27:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A20222F07; Sun, 4 Feb 2024 16:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="D9SAOIZL" Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 8828022EE9 for ; Sun, 4 Feb 2024 16:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707064011; cv=none; b=iL8BHuiT85zV8fqWuOCt79K2UQNYztGPEjcxCL3FiPbWHEXQpvy5N1UKXt6kNJATky+MsQhFVgKSS4AlLnOpbLmPIrD3loekg83IliSqc11fxPaLlqphbFUzK4Ve6bK4PEeUhCaJdIdNFa9klMEiARaeN2XUabIbn4gvdcXhHCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707064011; c=relaxed/simple; bh=YWptjRpXcGqKrXDeLb0WkkVr46kdOit9xa7JmKCgiVc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XfADBmJA5afxQj8j8gk168cUA2aQhgNlSEpH/kQ34p5Rd9gGPnPeOre8xaKCTN4R3gifLUGrE0ka5nEXGxX7f0YakcEvUvR8OHGbkCKmm+IojRoO5SECZOH6tab8t+oDHyS9cXfTV4gIwk3LOnqIaD4KiGNWrMoquot4qw9pz9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=D9SAOIZL; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-5d862e8b163so1187756a12.1 for ; Sun, 04 Feb 2024 08:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1707064008; x=1707668808; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4QsMafIxNnK2tT3E+d+X68HEoyZ0oqU7kYpJhvEviWU=; b=D9SAOIZLBnfzT+V42SiOJpeBJedg7s54vGo6VNBdLeKH+w74cVMQHHlp1bcsg3pL8Z 7SBehekzqbrZ56dqUw/kYHwTBPH53ZuXPsUn/LmFhpOxfqLI/LctXa5b56QxFbfTCON8 3p5bWDxCLkitkDEXth3xVg05o6SqgCHP0l3NhInLGvOe3D4IiwFIpSbB/2L/93ekY1M/ xTET+NhyrdT5L3Hw1MiwelPd0YFqEwzMt6eE5YDgCBTuFrWB4+s+2gM7cZNJFaJ2VNQG u0XgILtVTOciWF4MdLW+IbskBOmkhYTjf7lbD5iMKIUBSXxuKxqYg8M4naLhVwOoAwqL 4fuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707064008; x=1707668808; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4QsMafIxNnK2tT3E+d+X68HEoyZ0oqU7kYpJhvEviWU=; b=gwWWSYfeAmDGNA3SX5K2lIQ4UvCyHYMlqNKK0wL2hkIHybusA/gG5qfEUj7GwWhfdB ufblup9ScOiQSlJCnKHOFcwfkRFdhwGZZSM8g6SRw94D30kyZ8pxOw4smFeL0PJqanxx cwzbMcZKqMy1AK/GXX1HzV+l5ZSKye9/llBXvJnL+u6cBD1rME33M/y8+1+ncYEUKOHZ 9RgbZBJ3PHSLbMw/nsIB7/B6o4MnEeme6N/wvsebYygLrkk0v5v7QIc7CbH2fb+EySGL AEjtnfqUwPxy1NtPVtIjDs6ZgF12HNUNoK6HCY53POXERcrueoOs5Cp7V8ISgW0C6ZtE qCTA== X-Gm-Message-State: AOJu0YyuHKvGEKkz1oHKF2V6Ecvm+lj4FQCQ3CIxKCI33Yb+aBlFi6Xc OYjqdPWqroox0K0F0OdVIJMiXWVAJShUahX2Ua5fgFyUcLvm/+JQ0mgLMJZN03E= X-Received: by 2002:a05:6a00:1c96:b0:6e0:4576:f7e0 with SMTP id y22-20020a056a001c9600b006e04576f7e0mr370773pfw.2.1707064007870; Sun, 04 Feb 2024 08:26:47 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCU9qlQk1dly9VAoSOboZq8pD9fGdkndwUSu5KrIAO6PNtnP46oyJGHeHIyH+DvRKfTzIMJcU96Bx1CySYzoOBaXrFdAs2TALd7W+GPWDEbC489PvGofGEYv0UdJg8EEhDOQ9ncmUsiq2z+mwcxI/mOQ5qY24hPGhlBe31bPf1SlU2SNOZ05k+mzYfOHFZ+1TM56vqi3gYtxI05PClD7RAzdUXOl5gDx1pqzBgI9BpmiaE3GWerHCKo5mdp3d5u30tva/nghn9B92yuyZMdsQXfzLUQqiLo= Received: from [10.254.132.93] ([139.177.225.248]) by smtp.gmail.com with ESMTPSA id le10-20020a056a004fca00b006e02f222c2esm2331289pfb.30.2024.02.04.08.26.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Feb 2024 08:26:47 -0800 (PST) Message-ID: <9ef34638-a3e3-4e86-a96e-bc4694661adb@bytedance.com> Date: Mon, 5 Feb 2024 00:26:37 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] mm: pgtable: add missing flag and statistics for kernel PTE page Content-Language: en-US To: Mike Rapoport , akpm@linux-foundation.org Cc: arnd@arndb.de, muchun.song@linux.dev, david@redhat.com, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org References: <3b7e9435-d78e-4430-98d1-f4a839899425@bytedance.com> From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/2/4 20:15, Mike Rapoport wrote: > On Sun, Feb 04, 2024 at 07:39:38PM +0800, Qi Zheng wrote: >> Hi Mike, >> >> On 2024/2/4 18:58, Mike Rapoport wrote: >>> 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. >>>> >>>> Signed-off-by: Qi Zheng >>>> --- >>>> include/asm-generic/pgalloc.h | 7 ++++++- >>>> include/linux/mm.h | 21 ++++++++++++++++----- >>>> 2 files changed, 22 insertions(+), 6 deletions(-) >>> >>> This should also update the architectures that define >>> __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL, otherwise NR_PAGETABLE counts will get >>> wrong. >> >> Yes, this patchset only focuses on the generic implementation. For those >> architectures that define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL, some reuse >> the generic __pte_alloc_one_kernel(), but some have their own customized >> implementations, which indeed need to be fixed. >> >> I wasn't familiar with those architectures and didn't investigate why >> they couldn't reuse the generic __pte_alloc_one_kernel(), so I didn't >> fix them. > > But with your patch NR_PAGETABLE will underflow e.g. on arm and it'd be a > regression for no good reason. Oh, I see. In some architectures, they implement their own pte_alloc_one_kernel() and do not call generic __pte_alloc_one_kernel(), but still reuse generic pte_free_kernel(). So it needs to be fixed together. I will try to fix them and send the v2. But since I'm on vacation recently, updates may not be quick. Hi Andrew, please help to temporarily remove this patchset from the mm-unstable. Thanks! > >> It would be better if there are maintainers corresponding to >> the architecture who can help fix it. After all, they have a better >> understanding of the historical background and have a testing >> environment. ;) >