From patchwork Mon Mar 4 11:07:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13580425 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 DFE72C5478C for ; Mon, 4 Mar 2024 11:08:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 789436B007D; Mon, 4 Mar 2024 06:08:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 738206B007E; Mon, 4 Mar 2024 06:08:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DA106B0080; Mon, 4 Mar 2024 06:08:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4843D6B007D for ; Mon, 4 Mar 2024 06:08:15 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1E8371C08A5 for ; Mon, 4 Mar 2024 11:08:15 +0000 (UTC) X-FDA: 81859082550.09.EAE8B2C Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf25.hostedemail.com (Postfix) with ESMTP id 774A1A0022 for ; Mon, 4 Mar 2024 11:08:13 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Nmb78OvV; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf25.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709550493; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KtIXFJcfM5neAeyBfBxq1hZ3fmqqVOtLZ2hkhXv5tMY=; b=mfKCIkRgb+szH4FOjJr2sfh6MLoYVtT3NFYjJJ8HjCavd1AbtvTW4ofC6YE5fFA0v9/OCD c36Pvl9AP7TmOF8bN9G/G5JTCvJ9pEbjUYRAUbZqUGl0udDDXlf7XyKH+vh28odeKbre4A SQZ3qq0pHSz0SPON3ICMnDAe0LYbIqg= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Nmb78OvV; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf25.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709550493; a=rsa-sha256; cv=none; b=41mngIi+ICmwraGZW03QWZpfjGXgb53sIYfbpwkMsmt5RWyAuBpsZSIwG26YV+pvSrIgGU 3Yga+8QG7jUepYUAVlhrbX5OEI3r02PzjW3eZl5yf57FnrKgxhSijIv1ipnYC71rS1vHhB w8Oevwer08ZGtor3gz3tJ+B2EV2fKjg= Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5cfcf509fbdso1680785a12.1 for ; Mon, 04 Mar 2024 03:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709550492; x=1710155292; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KtIXFJcfM5neAeyBfBxq1hZ3fmqqVOtLZ2hkhXv5tMY=; b=Nmb78OvVBYXob4a/HKl8wFJK56qMBp41mQQQMCoZ+xkd2gHaP+5L2CgiSXhOPRLkCO 7Q8NtFo95o1EOB+WCx8PNNhCuVExDVM3AcV+Tbe8ZJ73PDyzqRdX9jKgZVyWxKICP6Mg S/zXepp+ZwPgHT03VejhElBXHge3QNYnQRgJdpnjc9dvPEvrzfzk+RwC327uNusxIFkq 6jOrHJfDgbbYcQJ6nVO+CS5wMyHUm/Mb+E8AxTdUxZUdcdVXjri8YrxwL7SCUFDaItRD 97bWzYKhECVYE0yCrXqkjeNDR4Fi/1d9rSWu/bmuzs97pf3lTF5j78nCgMAWcgLPlxLF YHDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709550492; x=1710155292; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KtIXFJcfM5neAeyBfBxq1hZ3fmqqVOtLZ2hkhXv5tMY=; b=MIWMBFNfZqpQLWoIX3l9D4k/hy6PkFZ+3lJQqrqflrfKDsPL+rKwgZTv/oLtpy2fDJ pYrUB6zStSSVmF8hy5JWtNa8LYWvgQVqUYxvS7r1kR+XoaVA5Ye+s/j7uLnawGE9LQOT q1UitOhsUj/vY9C9gENQae1gL+CKqgxVOEYJUAbjjPT5RgdaS8KBEXM5Szllv7nZ/kal QcNDnZg3EnQ8gPJQcQBdC+/9Wm1nVxiY//oTOuYZwd1Sw7fpL/9SSxX07aYaQwd3ZfvC RemUoUi8k3Jo7LNeM4N0HSgNkN2Y9RA/GdBxzMhckqjWxTxJduTJ8hwB7PCiemgs3HVT VySQ== X-Gm-Message-State: AOJu0YwiJOXpKNcTYspGFKgnt4RHxWPmA+DDT52pSRP552VQYDKk7jO0 HFyl4jKqnVemKANE1nu5En3DGxbrM3AkhygKqLQ+RBPMwMnAqNapuO3gy3c7fCk= X-Google-Smtp-Source: AGHT+IHFdup7gqVcwPWUuP5Df16ockl+ZC0JJEHwoOQgPVW2YrofdTAkF/kgzYWVAY+1V3T3ucMfEQ== X-Received: by 2002:a17:90b:1908:b0:29b:309b:a200 with SMTP id mp8-20020a17090b190800b0029b309ba200mr5173828pjb.3.1709550492018; Mon, 04 Mar 2024 03:08:12 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.154]) by smtp.gmail.com with ESMTPSA id y5-20020a17090aca8500b0029b59bf77b4sm587410pjt.42.2024.03.04.03.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:08:11 -0800 (PST) From: Qi Zheng To: akpm@linux-foundation.org, vishal.moola@gmail.com, hughd@google.com, david@redhat.com, rppt@kernel.org, willy@infradead.org, muchun.song@linux.dev Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH 1/3] mm: pgtable: correct the wrong comment about ptdesc->__page_flags Date: Mon, 4 Mar 2024 19:07:18 +0800 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 774A1A0022 X-Stat-Signature: recbkqgfjiddwwbtfmi5tt4169tyf5z4 X-HE-Tag: 1709550493-278488 X-HE-Meta: U2FsdGVkX1/KxFOuoafV5pm03n+qff+/8HLET+D10swe4/HCGSL/9MQRv3fL4v+J2hJh4MoNYnMKwsIAv06nMLFb8X3q8/dSgSjNRCxV9+ddosrwZEHWjN9TGrLJyu1kD79hq3VioGNOcte3GRWr40eX7YP7DTDj4/Ru/1dCbHIgbqjYcv97cIdD/jmOhbuC7cNzK+wwRWM4fAe6AH2snzr5FPLVGiauDN83wPeaSlh+R7mevRTS6d47s//C6EUiPBvWvQDrXw1kL+ouPqwim5YZ9nWMTzvj43IRIkXWIu5WGVslZisTdGBnoTiVHynFuRjYQd3ZXvDOX6BenK39kkUksTpSYE9/fCgSzZF7xUf1GiHAtMARxxCS4sECcmFyir4y0dQc60v7N9EHhnz/CU9Zmn/2IJxmzikOI0Xm3u3u70vueVyMdIZOGoSJ1ZzrZ3Qyfe+ugHtg4vpK91du9A4nRtg91yX7V3+gfLY02ZLjWOL1hn+hvLKOMb0NxfvQjMwSgqXoSttP6hzb4THpbj1tM7JYZQK3/OHjp47ZJERAC7cdoxwmBdttN6kFm6QT0jvkfiqbclYZv13HE5lR4RsH2F+/wW+IcxtVHfTuGgm1sT9mzLG40vPyrxHihYOhGPNuQ2tPC453d1gUng4+cXX1vqjAPKZQt9B7YBEPkbuGWgBhwfJre+0B5/e5vS6ipHok509I3cr3IBuXl8rVkunx02te5e6rpdfjlnwhdmDibiQ89TBMOWg1TtwXj9oc35pt3jAFEwoAwuWK7A1tK79CDkEdELxCuVtxUziVbJpijUlvL4j0FV+IduKhQWjnMcbXDSVXqFMTndnHSmFTE8jXCWMVLH1BCaOFfDtgZvvgsvmLZys/mJyMlnbeoM6H4LQ4tCHDRwjBcm70A2sQkUVYzxXEhJ3dgtwUZSYssqfC6eEH63YbWDOBM36I66+NUXsLeeIs4xiJlL7+xE5 lvBV4vUU YGAS0rCKSVbxVbHH6aCQwdPe4z7idwMl54hLmy+y59205p/+rLuR0+ILuRD08icRqumItlDYyvUleUNmsfq0DDdhbFEx7sTZUdDsK33DYPjx5lLqXk8h1SMuvB3joPVKx5SwqHypLoHKB88ncbOynnXtInjcS9h4kSUmwczBKlLAuLlb83DQGAzDApx8iv0U5Z5xkR3bQGan3dgJDndPn7i1QaUgw5qMgjl6gs59tIZWj02L28sbCSEIkvJugQ226Yujc X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The commit 32cc0b7c9d50 ("powerpc: add pte_free_defer() for pgtables sharing page") introduced the use of PageActive flag to page table fragments tracking, so the ptdesc->__page_flags is not unused, so correct the wrong comment. Signed-off-by: Qi Zheng Reviewed-by: Vishal Moola (Oracle) --- include/linux/mm_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index a7223ba3ea1e..5ea77969daae 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -419,7 +419,7 @@ FOLIO_MATCH(compound_head, _head_2a); /** * struct ptdesc - Memory descriptor for page tables. - * @__page_flags: Same as page flags. Unused for page tables. + * @__page_flags: Same as page flags. Powerpc only. * @pt_rcu_head: For freeing page table pages. * @pt_list: List of used page tables. Used for s390 and x86. * @_pt_pad_1: Padding that aliases with page's compound head. From patchwork Mon Mar 4 11:07:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13580426 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 D430EC5478C for ; Mon, 4 Mar 2024 11:08:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 678056B0081; Mon, 4 Mar 2024 06:08:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 629D46B0082; Mon, 4 Mar 2024 06:08:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C9BD6B0083; Mon, 4 Mar 2024 06:08:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 372846B0081 for ; Mon, 4 Mar 2024 06:08:19 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0EF1B120A65 for ; Mon, 4 Mar 2024 11:08:19 +0000 (UTC) X-FDA: 81859082718.04.43FF7E3 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf27.hostedemail.com (Postfix) with ESMTP id 5E8D940029 for ; Mon, 4 Mar 2024 11:08:17 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=H8W8ZA2t; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf27.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709550497; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MVpQb6gnXjWzSd7/4z2SbTtHslRCQp5WpZHkGdzmg3w=; b=G5sZ2Ao5PZz07TqiqKgNxRtr3/SZDmKXWsv0aY2658MGwGME/VdkJMoO2mOj66hrfSBzQk FZbSY9rrKuX5hqGAZxP+jounu1bBaiiTITBkf1c3hHzAxQ/NvuaUqhLvPwjRgYvFQ3iPau UfIr72ZhLeQ+OV9QRgQi3SX9DLXhIPo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=H8W8ZA2t; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf27.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709550497; a=rsa-sha256; cv=none; b=XOSDMRDRLhhLRY3oB6TiLRawHocQH2Ab8LHKDxfux39PGB3Di++4x4vZ+KbtHTO0oE4BHQ P0KiDIhB0m01S1mogFP8exFUPr6ql6DFrVugSqHkik27kWNfg+L5wfpcPNHPMb63z01ERO j5QrVRiupJzmLnjOe7T/yytZ6NiBALU= Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-29b2a3d4dd6so180250a91.1 for ; Mon, 04 Mar 2024 03:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709550496; x=1710155296; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MVpQb6gnXjWzSd7/4z2SbTtHslRCQp5WpZHkGdzmg3w=; b=H8W8ZA2tJSCt7ANaylJ7pyIVCu37vLrU+D/WDc4nVM63nKAZYCq+fW6htM6TqQKrwt MkftHqurf4iA5hT8Mikn7T3Ki22i0Q9fPLkmRB0CAeGyBILRmdeTcn8QKcpT2Lm8Br0I P4aaaNDLxrmb6dYRMTnPuiXXRdHmTxHsbfrJ66NLkohStrVGAz67VNJORcCctVRy9JYQ yE6HIq3ri96Z2pbmrtCyfBMpAG856LwJ37/PIp4H+ppYCEj4f/KlBTYf7a4wIfjQHAMI Xpxj/Q9ZjxUB2aBsjPLUT3WuC7hBy+fKjMnKZnucluvcz5ovty9YUsq/PV1rEwrA3lXr mdLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709550496; x=1710155296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MVpQb6gnXjWzSd7/4z2SbTtHslRCQp5WpZHkGdzmg3w=; b=HaLCYizIJ63nd0jvRakj6XIvrhPhS0LaevvyPjWW6Gui+1RMiQs43ypSr5Wq02DMiR RoB7K8oHrmAh1NYeFgAP5Wy0X35JM4tUR/hC/NfTwwGgQag8pSo6orcSFnZSkt3hQgYV UEOm+XKprhIiUmkzuUQU0GBPvEloDSo3gyCM5U9mylBAjUbbVHPit9vhFA5aAwXKrgj5 AEO3ZJf0/lL/QsLnv54JbRgqIXcarJDwSsT3V4KkoFi68z2dR++MA5rPxX/MZgGBDBdI G6BZidyZK7lpVj+gPUzRa6p9ow6TF62/S67XwR7wgZ7uTvajoIBdGw+AkYeb64V4AbDx U4Lw== X-Gm-Message-State: AOJu0Yxdwk1w7CFPuzhnoEtxWvzLWOPTBVv7P//OmWzCn/8AdNl1LS4N hUIBcDZNlkxlac8fiqY4mzwuxW7SeO1E+riVPc6oCprEdSjbt2XgVYs8DYzhHYo= X-Google-Smtp-Source: AGHT+IFSfl5xFUSoidYT+0L1kpEdhILm//TZZr/lpxpdHBQlvBKsRDyghgFJOAi+dVG4ZEhfPEedDw== X-Received: by 2002:a17:90a:804c:b0:299:dddb:3a92 with SMTP id e12-20020a17090a804c00b00299dddb3a92mr6941943pjw.1.1709550496198; Mon, 04 Mar 2024 03:08:16 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.154]) by smtp.gmail.com with ESMTPSA id y5-20020a17090aca8500b0029b59bf77b4sm587410pjt.42.2024.03.04.03.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:08:15 -0800 (PST) From: Qi Zheng To: akpm@linux-foundation.org, vishal.moola@gmail.com, hughd@google.com, david@redhat.com, rppt@kernel.org, willy@infradead.org, muchun.song@linux.dev Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH 2/3] mm: pgtable: add missing pt_index to struct ptdesc Date: Mon, 4 Mar 2024 19:07:19 +0800 Message-Id: <283624c2af45fb2090b41a6b1b5481bb0a45bad7.1709541697.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5E8D940029 X-Stat-Signature: o8pyysecrbxb6a54dctc31w3bcbgpzt3 X-Rspam-User: X-HE-Tag: 1709550497-565390 X-HE-Meta: U2FsdGVkX1+XlGhN/AoNxZC5OQ0iJFPeujOyehQxn9qG2oIZLQ49vlWASPEx42QzkEV1E08PeakbztwzAJC4TMoZeTAueDahxBcOgjIA5gT41IN125BEJ+MxcpsAOidIt30Q78WU9osodY/KAygIj5iu/gnsIHEyyLrTJVpmDHKkU11Yjb9MovAPs3vbgEvNGuJyhohfHzI20ZTx/tkBT02JbUcB5gMRQA9cc7ryuexLYdccyTJ6p+VJ2mZ/w9FMnFH4Ug+6ZciudWNgai66NRqTe3vv/6zu/rgHQPp79DdjMZ0KjgMfDcEPD+/aauLevrdhG40B7eUYTsq+W6wPG/s20g+hS3UeIj3+mFqSqBtXQZQ+BJNevnL3eRbgPVsIVs3ODq9h/KBnNy7bqeRI3xaR2BbTOy10IsCdTQdZrUJ+CjvKMibsbtXD2O+8GFLIf3hVwShummbNVoO2IW34494egktVJ8y1KC4v+KXnh/NVMOGpRGMg/f0w3Nz0GcIhrLl75nJGPI22UP+ccGJcoMapPqSZ0UIJPZ2ljyQWyN2eeU43WoZ0ehO67DJ+Yw4oeW4W2F3C5ZPimvjeUscFFpyUnEXCBN+0/ZPdIPYhAioU6GYJjDBuHgI9siptBdKhr9pwjb8PEw/0WLywgma/hjTrApITMMDzqx38/N0VwmOQ7lPk39KfCX+FlT1OCRllEzexrb/CiOrtiIYUAcMkLLr8jnVNT1B+oRkNiAsaWieQt9uMrM7x6YtxuNbM+HaCN/9g2yi1cEMfe8n4swB6m6TrOsv6DiYJpN1gB6sRZRDWmZ2gaqp/C67jcD9zEW/Z2ooL/+iGPbtkSSGE1AQOeVNEmBpw2r8hsFIrxTEvyM3i6xwp7rvqrpn4jUwag/cFqdSwWCPnJelhexB7vyktkt6yTlbBy3s7RKwDdn8W1zkvBPTLZH8cv3vWk2ZK+ziSHymAVur6rAoRr63UUZv Qg9vRhy0 sMzpwvme+aQZ4YVszZf9yWATQFqNMDZrlEAru4sgjG2nDedyCEHEdgaBt5KmV6oa4Un0y5Xor+CVHgfbVgaHJFDokxCOEPZbbDwr4Fwg7iqnHa0MVdTjZmGmlhnUolEh/v5KfXexx6igPd0vevbv2jmwCUMD3n7wAq+rcFtG0g6i7H8qQGpRKXEB8DZMAHUucEEe08k9B6W/vhNGpq7UnRKsms64qWwVl9Aro78jnKBBtTyn6IIRrkbbssQ== 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: In s390, the page->index field is used for gmap (see gmap_shadow_pgt()), so add the corresponding pt_index to struct ptdesc and add a comment to clarify this. Signed-off-by: Qi Zheng --- include/linux/mm_types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5ea77969daae..5240bd7bca33 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -425,6 +425,7 @@ FOLIO_MATCH(compound_head, _head_2a); * @_pt_pad_1: Padding that aliases with page's compound head. * @pmd_huge_pte: Protected by ptdesc->ptl, used for THPs. * @__page_mapping: Aliases with page->mapping. Unused for page tables. + * @pt_index: Used for s390 gmap. * @pt_mm: Used for x86 pgds. * @pt_frag_refcount: For fragmented page table tracking. Powerpc only. * @_pt_pad_2: Padding to ensure proper alignment. @@ -450,6 +451,7 @@ struct ptdesc { unsigned long __page_mapping; union { + pgoff_t pt_index; struct mm_struct *pt_mm; atomic_t pt_frag_refcount; }; @@ -475,6 +477,7 @@ TABLE_MATCH(flags, __page_flags); TABLE_MATCH(compound_head, pt_list); TABLE_MATCH(compound_head, _pt_pad_1); TABLE_MATCH(mapping, __page_mapping); +TABLE_MATCH(index, pt_index); TABLE_MATCH(rcu_head, pt_rcu_head); TABLE_MATCH(page_type, __page_type); TABLE_MATCH(_refcount, __page_refcount); From patchwork Mon Mar 4 11:07:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13580427 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 724B9C5478C for ; Mon, 4 Mar 2024 11:08:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 036896B0083; Mon, 4 Mar 2024 06:08:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F278D6B0088; Mon, 4 Mar 2024 06:08:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC8FA6B0089; Mon, 4 Mar 2024 06:08:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C76FD6B0083 for ; Mon, 4 Mar 2024 06:08:24 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7F0511C095F for ; Mon, 4 Mar 2024 11:08:24 +0000 (UTC) X-FDA: 81859082928.12.4C63F0F Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf01.hostedemail.com (Postfix) with ESMTP id D543E4000F for ; Mon, 4 Mar 2024 11:08:22 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b="RfTUjtN/"; spf=pass (imf01.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709550502; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2RLTgvH0qYoneoQ+N+6ayDYFDcXGD4luCEt+X8Py56w=; b=kI8gCeVEtZ4VSUnVMg5JTivLDBa3QdsxFZmlIGUxcRyjpqpA4zRoSTr4uEeWejEQLLHDlV zHZZNJ4py6IlBvajQIAdKmzF2XA63mlYne2JQBBGOk3J87aZeqGK4yAQP/Fy5TlTKW3wJ1 wnm5vu4R2bpcXOoqAE4QRdLUjSDf5I4= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b="RfTUjtN/"; spf=pass (imf01.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709550502; a=rsa-sha256; cv=none; b=J2ElAegNrpR+v1DyfjNINPeE7tjc5PaH2X2SVrwtJD6EAQuhoF3tW8fJ3J4Ekwn+fZ8DER 7PTUvIhQl/i7lkHsdrtjDMCTtB8Avr7sBQdGfP/2xFyOb0FALdERACOsOfynwtHyp5WLML VNpV9XVvjNn0ULrKatNNx9Z3R36KQTo= Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-5cfb8126375so673488a12.1 for ; Mon, 04 Mar 2024 03:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709550502; x=1710155302; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2RLTgvH0qYoneoQ+N+6ayDYFDcXGD4luCEt+X8Py56w=; b=RfTUjtN/sY1nvlEFaZzfxswBLVWk7/r/AHFY4e94xdMBA+v6rxb/oN/K8ieGa49i0S Xghfm3dgJ455FxqZQaGQPp1dCPNMrvEAFSssJfHF8bkxSrJREXZY2bv0eRubSxrRqVWe EyXDALaWXZbVN/Vv/vrpzpcFO5tDDA8siptsaNG7j+yOcz15kVZiZ/meSFFLLFebJkGY uza5Drm4b02RiisayyBfppEzQ/ui54i0ypxisRd931CjNcjqFPEHrwIaBey810jM+meX Yx4nZi9chruIVeyHptjSzaC94OU+hquFg/T20/x4Ndi2mTk+zuSOo6GQYLtZARFHCEM2 Oguw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709550502; x=1710155302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2RLTgvH0qYoneoQ+N+6ayDYFDcXGD4luCEt+X8Py56w=; b=gqjf4pHdz45s+GqL7PQs1WfBtR6tre2ACwOe7KdehCKvMHPWhNiLPFdOKxDZA2vd3S jJuk+16772jMQEUacLDvDh6ct6C/4NcZwzXPQvdravX6wO8jCS0oY4kjdQsQrbNc3z/m +lAf29fTUTVh3YsRpM9KBRQpKrIVahi/k5B8frRQvCGvgWDzb3qmtPQs5OCJYEjCp+Ys J0vydPw6oQUb0ZUV7a5n5nPpSSPvmXaI1G6IRwKlpH3m5l/ltRl+FxZHM7c2LQAFZ4x9 NuerniAqYbaT/tOd8iam0p1+Uw+tMWdoPzEZFLq1jXd5k3CIzMabCPEJE+kJwiD0SI3x 2hLA== X-Gm-Message-State: AOJu0Yxzs3tphTSXCVZDBSHkX8I259wDPm1v5pI23hnYXfQXiSIf8RQR XbJJdndWkVXNyQUaTHVDYu8mD5SH8v7qy1/h3fmg9eQgWkbbofs1OXUgHD8VjPI= X-Google-Smtp-Source: AGHT+IFBOOIUNI94cOhOoYb8AwpERd5isoTBK9odWtV+MEuzyzhHwVrtYw8sFJceXMlJR9tIyeo1cQ== X-Received: by 2002:a05:6a20:1b30:b0:1a1:480e:7711 with SMTP id ch48-20020a056a201b3000b001a1480e7711mr5045368pzb.0.1709550501853; Mon, 04 Mar 2024 03:08:21 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.154]) by smtp.gmail.com with ESMTPSA id y5-20020a17090aca8500b0029b59bf77b4sm587410pjt.42.2024.03.04.03.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:08:21 -0800 (PST) From: Qi Zheng To: akpm@linux-foundation.org, vishal.moola@gmail.com, hughd@google.com, david@redhat.com, rppt@kernel.org, willy@infradead.org, muchun.song@linux.dev Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 3/3] s390: supplement for ptdesc conversion Date: Mon, 4 Mar 2024 19:07:20 +0800 Message-Id: <04beaf3255056ffe131a5ea595736066c1e84756.1709541697.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: D543E4000F X-Rspam-User: X-Stat-Signature: ysjo7rumirj6z9g5aj7xbr617jwo7o5e X-Rspamd-Server: rspam01 X-HE-Tag: 1709550502-839467 X-HE-Meta: U2FsdGVkX185sscNKOnakhyl52iRKMUuY1QcgJEsUruASBgu/Kqv3/YhbggDGQvZQLH5Xf8pObqw/uRnbJFhi9fzL7nD3Srt6BSccU09ArrIAkdvT1lVhbULu5E8lChQ4jGZQl3BdiNxt58VUmGlHxGaCF9DtdRJUueTnMDAPZKht6bTJT9GHwDwKtnZWU1zDjxrCa8qOV4CimzeoRfmZecXFmFWDED6p90xr2w2fpp+ZYCZqzhrpkaIJaVrJHp427btoB+0Fwb+q2uG8h5Uxruy9cMhkG2bfO/GG+tYkHhA/UbhC+7LOyKDc8YQvip2xGYTiQR2Hsehok/FDI9Mbm9obpLCxZ3EUKFirj7RWbeMnQjhC+1x437hCJfkpDepB7ZMdT6KY+jqydDzfuAmtHOMoIDqqvDtdoEed6g9LyactVrYLLh1ZivIRPjjLjll1PuP1dC139XJ0TuTW0Fcc8Dkr0fNqYSdCzHpKOpELbswy2hkIUlet6UaggwgHNdbP3xSJLbI37DVGWSP3qG46Wr4sRlMBZ6UEsiO3kWMsH7ryckCV6fAat+x6Zo+fuUCYuXBLBU25anaog9AsRbuoKIMx90njIApHIQHdT0TmEDdJK7tHHZ4jAv5nMJ30IUb6fsnlQ2FHJXc7MAh5yktA/TAomEJGXkD9wry2JLoy5hw6XELKRX1jA0xeDPF2fnYaaIOQ6zCmUM3xI+RKdFWRwTpJUmohJOfYv/gPNDB7CFQTvN1RmHkgFXVSgsTuLiZqJQ4gtx6lSm/zlj6S4ENo6kcZqv6XP2/4exfa7Qr0zVWPKdu9bB6zJGDN/cKaMCMO+dhBoNwDaHxutTd4KObppqGGFXI/SMsfkKNcYk/xe7TeuWGdmFEA8KX63BG2PK3MNGzELquuHxZHc/nIeYJDH+0JuaPVoLnew3SWJS6+a6uGgLANFhio0IIWFwT2c2oVYgMBFzZigAkLZoZBVg qvkZDiJs QnNSFUVS+atGSesZrYKunRId4RbCWSBLcvOjSRZKRQIz6FLqV2hLolZRlg4na5obs++9U5d3qIKuQWjSoiQvEcTaG88ULz7D8Ih5oe4QweenSu/KIndPjBhcomi83DGc0cmsjfIrpmQrR6FEcyLvc468w8GBx+mD5WnoY2sCkpBFAAq/dtFHh6F0acoM7+zPeWifPIE6naBXLVK8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001414, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: After commit 6326c26c1514 ("s390: convert various pgalloc functions to use ptdescs"), there are still some positions that use page->{lru, index} instead of ptdesc->{pt_list, pt_index}. In order to make the use of ptdesc->{pt_list, pt_index} clearer, it would be better to convert them as well. Signed-off-by: Qi Zheng Cc: Christian Borntraeger Cc: Janosch Frank Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org --- arch/s390/include/asm/pgalloc.h | 4 ++-- arch/s390/mm/gmap.c | 38 +++++++++++++++++---------------- arch/s390/mm/pgalloc.c | 8 +++---- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h index 502d655fe6ae..7b84ef6dc4b6 100644 --- a/arch/s390/include/asm/pgalloc.h +++ b/arch/s390/include/asm/pgalloc.h @@ -23,9 +23,9 @@ unsigned long *crst_table_alloc(struct mm_struct *); void crst_table_free(struct mm_struct *, unsigned long *); unsigned long *page_table_alloc(struct mm_struct *); -struct page *page_table_alloc_pgste(struct mm_struct *mm); +struct ptdesc *page_table_alloc_pgste(struct mm_struct *mm); void page_table_free(struct mm_struct *, unsigned long *); -void page_table_free_pgste(struct page *page); +void page_table_free_pgste(struct ptdesc *ptdesc); extern int page_table_allocate_pgste; static inline void crst_table_init(unsigned long *crst, unsigned long entry) diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index 8da39deb56ca..4d2674f89322 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -206,9 +206,11 @@ static void gmap_free(struct gmap *gmap) /* Free additional data for a shadow gmap */ if (gmap_is_shadow(gmap)) { + struct ptdesc *ptdesc; + /* Free all page tables. */ - list_for_each_entry_safe(page, next, &gmap->pt_list, lru) - page_table_free_pgste(page); + list_for_each_entry_safe(ptdesc, next, &gmap->pt_list, pt_list) + page_table_free_pgste(ptdesc); gmap_rmap_radix_tree_free(&gmap->host_to_rmap); /* Release reference to the parent */ gmap_put(gmap->parent); @@ -1348,7 +1350,7 @@ static void gmap_unshadow_pgt(struct gmap *sg, unsigned long raddr) { unsigned long *ste; phys_addr_t sto, pgt; - struct page *page; + struct ptdesc *ptdesc; BUG_ON(!gmap_is_shadow(sg)); ste = gmap_table_walk(sg, raddr, 1); /* get segment pointer */ @@ -1361,9 +1363,9 @@ static void gmap_unshadow_pgt(struct gmap *sg, unsigned long raddr) *ste = _SEGMENT_ENTRY_EMPTY; __gmap_unshadow_pgt(sg, raddr, __va(pgt)); /* Free page table */ - page = phys_to_page(pgt); - list_del(&page->lru); - page_table_free_pgste(page); + ptdesc = page_ptdesc(phys_to_page(pgt)); + list_del(&ptdesc->pt_list); + page_table_free_pgste(ptdesc); } /** @@ -1377,7 +1379,7 @@ static void gmap_unshadow_pgt(struct gmap *sg, unsigned long raddr) static void __gmap_unshadow_sgt(struct gmap *sg, unsigned long raddr, unsigned long *sgt) { - struct page *page; + struct ptdesc *ptdesc; phys_addr_t pgt; int i; @@ -1389,9 +1391,9 @@ static void __gmap_unshadow_sgt(struct gmap *sg, unsigned long raddr, sgt[i] = _SEGMENT_ENTRY_EMPTY; __gmap_unshadow_pgt(sg, raddr, __va(pgt)); /* Free page table */ - page = phys_to_page(pgt); - list_del(&page->lru); - page_table_free_pgste(page); + ptdesc = page_ptdesc(phys_to_page(pgt)); + list_del(&ptdesc->pt_list); + page_table_free_pgste(ptdesc); } } @@ -2058,19 +2060,19 @@ int gmap_shadow_pgt(struct gmap *sg, unsigned long saddr, unsigned long pgt, { unsigned long raddr, origin; unsigned long *table; - struct page *page; + struct ptdesc *ptdesc; phys_addr_t s_pgt; int rc; BUG_ON(!gmap_is_shadow(sg) || (pgt & _SEGMENT_ENTRY_LARGE)); /* Allocate a shadow page table */ - page = page_table_alloc_pgste(sg->mm); - if (!page) + ptdesc = page_table_alloc_pgste(sg->mm); + if (!ptdesc) return -ENOMEM; - page->index = pgt & _SEGMENT_ENTRY_ORIGIN; + ptdesc->pt_index = pgt & _SEGMENT_ENTRY_ORIGIN; if (fake) - page->index |= GMAP_SHADOW_FAKE_TABLE; - s_pgt = page_to_phys(page); + ptdesc->pt_index |= GMAP_SHADOW_FAKE_TABLE; + s_pgt = page_to_phys(ptdesc_page(ptdesc)); /* Install shadow page table */ spin_lock(&sg->guest_table_lock); table = gmap_table_walk(sg, saddr, 1); /* get segment pointer */ @@ -2088,7 +2090,7 @@ int gmap_shadow_pgt(struct gmap *sg, unsigned long saddr, unsigned long pgt, /* mark as invalid as long as the parent table is not protected */ *table = (unsigned long) s_pgt | _SEGMENT_ENTRY | (pgt & _SEGMENT_ENTRY_PROTECT) | _SEGMENT_ENTRY_INVALID; - list_add(&page->lru, &sg->pt_list); + list_add(&ptdesc->pt_list, &sg->pt_list); if (fake) { /* nothing to protect for fake tables */ *table &= ~_SEGMENT_ENTRY_INVALID; @@ -2114,7 +2116,7 @@ int gmap_shadow_pgt(struct gmap *sg, unsigned long saddr, unsigned long pgt, return rc; out_free: spin_unlock(&sg->guest_table_lock); - page_table_free_pgste(page); + page_table_free_pgste(ptdesc); return rc; } diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index 008e487c94a6..abb629d7e131 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c @@ -135,7 +135,7 @@ int crst_table_upgrade(struct mm_struct *mm, unsigned long end) #ifdef CONFIG_PGSTE -struct page *page_table_alloc_pgste(struct mm_struct *mm) +struct ptdesc *page_table_alloc_pgste(struct mm_struct *mm) { struct ptdesc *ptdesc; u64 *table; @@ -147,12 +147,12 @@ struct page *page_table_alloc_pgste(struct mm_struct *mm) memset64(table, _PAGE_INVALID, PTRS_PER_PTE); memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); } - return ptdesc_page(ptdesc); + return ptdesc; } -void page_table_free_pgste(struct page *page) +void page_table_free_pgste(struct ptdesc *ptdesc) { - pagetable_free(page_ptdesc(page)); + pagetable_free(ptdesc); } #endif /* CONFIG_PGSTE */