From patchwork Wed Dec 27 14:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinsey Ho X-Patchwork-Id: 183480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1455380dyb; Wed, 27 Dec 2023 06:13:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHS3Ug9BiFp6SrkUwUhmry1U9E1wodtZ8AsgxFJvcb894GoF1I2+d8vGHoSYyZZ7HoBzujE X-Received: by 2002:a05:6808:1512:b0:3b9:f151:7765 with SMTP id u18-20020a056808151200b003b9f1517765mr8929505oiw.27.1703686425329; Wed, 27 Dec 2023 06:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703686425; cv=none; d=google.com; s=arc-20160816; b=M9nYF1Tjgzx9NHOXz4cpLpXpemvNdL3Gd5ENLCsevLhPZOyiHtl9MfbO2Zxp4F0Bol nhbCPMMDQxMZhi5d0mnrPaaTfW+50xZfssb1hNVB0OmS4TIhV7ona2nGAjRg4ZbMqWy+ tEtBTq7S9TnmsaKwcFtQL/V3WoxZmROOPHBPM1e56j2Cd1RZact14dY0IaXs3t7TxJ3Y 2zBpiL5cwfCBfjPZjuCpvDMQwa5JuwrMrC8KvtIAV4BQ1VIiIWA+7XSgGTKL5Wm40rbT IemM7E/XNBJ9M2SzCQ57oeF5npiLIZed/wk4fMn/HhaHoALL1D5vvR2kVk4Ea6uyzDMd LFkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=AMXZnWGUqNtn7KYJD8Fock0hYei0LYTTlWAZlt2Oe3E=; fh=Y2l/teiUJdPlrHsaEXa5Ys9+72CAcadxrE5yHw8U8ww=; b=1G6Oev+Vuq3+ZxSf8I9zqfnPKELLZmkpNRVnA+IrDGzXHx2r9ssrTPQowzgV2blBPG R5ys3SiHkV1egTyEBBPIzI8MDFcNvIxv60yokxcmLV6USjnULbhI6BAVvtwiRmhJhayZ xL0+NvFePpHwB04J6hgXfLq4E9Kpwf9BWSdHIIv+/PG9qAexEsoFzT3nwuqcUk3lChLj C44vOK5X9rqDND/J0GMMWOUJpCmhEJmOXAw1C6Bt4XgfDM58ROTIuzzjdpeVblAYBl1l rT3FaJJi9cyID6bWoJC9Ez0hXn6HHgI+xuR2Kwcgl7nHWNQnK2ytnJuu+qbG/IcKonk1 MdvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=DbQ5Lg3P; spf=pass (google.com: domain of linux-kernel+bounces-12048-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12048-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jn8-20020a05610219c800b0046715cf82e3si417723vsb.23.2023.12.27.06.13.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 06:13:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12048-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=DbQ5Lg3P; spf=pass (google.com: domain of linux-kernel+bounces-12048-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12048-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1AA761C217EA for ; Wed, 27 Dec 2023 14:13:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CF2F46B87; Wed, 27 Dec 2023 14:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DbQ5Lg3P" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 731DB46433 for ; Wed, 27 Dec 2023 14:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--kinseyho.bounces.google.com Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-28c05e74e36so5607862a91.0 for ; Wed, 27 Dec 2023 06:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703686347; x=1704291147; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=AMXZnWGUqNtn7KYJD8Fock0hYei0LYTTlWAZlt2Oe3E=; b=DbQ5Lg3PsGtgSH9TOHenyahbFAukf2XmW2LMMzXsUwQjkkM2Ei3ptkUFYh62kJNvXm 07+QwR4MulxALIv4St8HjVHD0ZGJhPjhkf7k8/3d1Lbn5kHYL1ajib9hDgicaT7Nc25q brQ8kvuKcT2HZluLqlvjRVCXyIc15jeqSEf3dFS0dh/hnPhL4knmKQdmRIjLgqkQLczy pTGEG02my65XiZXUAU3s/Sf2tNtWf4HrxQfKEfcQBkq2bY0y/3bubCo/UNjcjVZSpxWV iA2gArIA/0cG2KAZIEoTdZhjUtqgjgta2ORehMGXDucVllegG+RAJKbAUTEoQdb8Ng7s i7qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703686347; x=1704291147; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AMXZnWGUqNtn7KYJD8Fock0hYei0LYTTlWAZlt2Oe3E=; b=QbnZ/JjaydJlOU2tdzq29Rggx1ycDoPiciDOCxDpSAkKdDMsxYhsmIHaCyuwa+o+CJ ATs3tAbQlolIlr0QZMwphUQwMeovL+2mXAiWPwDvvmFJip2tf2uHhUXwZLta0AdfvABW vqESMnQUi2nslx2TAxRNew/8Aq2WhoAGj8GMPEYKEnAKo608OUfqFJP22GdmCMhMGlKv XbEeBrz73bTw2FJ4Gpg1Kul56SjyoaS2ME7eTQnBm9ckySM26FNtd+9OuYIkY1B33XL/ GrS870Jx3iJ3qoMtJZNTDNUZkb+rdjtP1cTEZDPLrVbGs5WuamtHWRQvezNkNYGaCPc8 y2Vg== X-Gm-Message-State: AOJu0YyfP0Ae286DDZ4zf9mCM92fhn4sDokGcxP3dT5YghYU8gYIwBtd JYOAZ4j7lAu89U6k0zC24AgstqInvv40O85g8zDL X-Received: from kinseyct.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:46b]) (user=kinseyho job=sendgmr) by 2002:a17:90b:4b8f:b0:28b:2844:c35e with SMTP id lr15-20020a17090b4b8f00b0028b2844c35emr998089pjb.5.1703686347664; Wed, 27 Dec 2023 06:12:27 -0800 (PST) Date: Wed, 27 Dec 2023 14:12:04 +0000 In-Reply-To: <20231227141205.2200125-1-kinseyho@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231227141205.2200125-1-kinseyho@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20231227141205.2200125-5-kinseyho@google.com> Subject: [PATCH mm-unstable v4 4/5] mm/mglru: add dummy pmd_dirty() From: Kinsey Ho To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao , Donet Tom , "Aneesh Kumar K . V" , Kinsey Ho , kernel test robot X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786444697116502597 X-GMAIL-MSGID: 1786444697116502597 Add dummy pmd_dirty() for architectures that don't provide it. This is similar to commit 6617da8fb565 ("mm: add dummy pmd_young() for architectures not having it"). Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312210606.1Etqz3M4-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202312210042.xQEiqlEh-lkp@intel.com/ Signed-off-by: Kinsey Ho Suggested-by: Yu Zhao --- arch/loongarch/include/asm/pgtable.h | 1 + arch/mips/include/asm/pgtable.h | 1 + arch/riscv/include/asm/pgtable.h | 1 + arch/s390/include/asm/pgtable.h | 1 + arch/sparc/include/asm/pgtable_64.h | 1 + arch/x86/include/asm/pgtable.h | 1 + include/linux/pgtable.h | 7 +++++++ 7 files changed, 13 insertions(+) diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index 29d9b12298bc..8b5df1bbf9e9 100644 --- a/arch/loongarch/include/asm/pgtable.h +++ b/arch/loongarch/include/asm/pgtable.h @@ -523,6 +523,7 @@ static inline pmd_t pmd_wrprotect(pmd_t pmd) return pmd; } +#define pmd_dirty pmd_dirty static inline int pmd_dirty(pmd_t pmd) { return !!(pmd_val(pmd) & (_PAGE_DIRTY | _PAGE_MODIFIED)); diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 430b208c0130..e27a4c83c548 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h @@ -655,6 +655,7 @@ static inline pmd_t pmd_mkwrite_novma(pmd_t pmd) return pmd; } +#define pmd_dirty pmd_dirty static inline int pmd_dirty(pmd_t pmd) { return !!(pmd_val(pmd) & _PAGE_MODIFIED); diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index ab00235b018f..7b4287f36054 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -673,6 +673,7 @@ static inline int pmd_write(pmd_t pmd) return pte_write(pmd_pte(pmd)); } +#define pmd_dirty pmd_dirty static inline int pmd_dirty(pmd_t pmd) { return pte_dirty(pmd_pte(pmd)); diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 601e87fa8a9a..1299b56e43f6 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -770,6 +770,7 @@ static inline int pud_write(pud_t pud) return (pud_val(pud) & _REGION3_ENTRY_WRITE) != 0; } +#define pmd_dirty pmd_dirty static inline int pmd_dirty(pmd_t pmd) { return (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0; diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 5e41033bf4ca..a8c871b7d786 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -706,6 +706,7 @@ static inline unsigned long pmd_write(pmd_t pmd) #define pud_write(pud) pte_write(__pte(pud_val(pud))) #ifdef CONFIG_TRANSPARENT_HUGEPAGE +#define pmd_dirty pmd_dirty static inline unsigned long pmd_dirty(pmd_t pmd) { pte_t pte = __pte(pmd_val(pmd)); diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 08b5cb22d9a6..9d077bca6a10 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -141,6 +141,7 @@ static inline int pte_young(pte_t pte) return pte_flags(pte) & _PAGE_ACCESSED; } +#define pmd_dirty pmd_dirty static inline bool pmd_dirty(pmd_t pmd) { return pmd_flags(pmd) & _PAGE_DIRTY_BITS; diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 9ecc20fa6269..466cf477551a 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -184,6 +184,13 @@ static inline int pmd_young(pmd_t pmd) } #endif +#ifndef pmd_dirty +static inline int pmd_dirty(pmd_t pmd) +{ + return 0; +} +#endif + /* * A facility to provide lazy MMU batching. This allows PTE updates and * page invalidations to be delayed until a call to leave lazy MMU mode