From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 903BDC433E0 for ; Wed, 17 Feb 2021 16:24:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF57C60C3E for ; Wed, 17 Feb 2021 16:24:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF57C60C3E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 513486B0006; Wed, 17 Feb 2021 11:24:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4998F6B006C; Wed, 17 Feb 2021 11:24:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 388BF6B006E; Wed, 17 Feb 2021 11:24:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id 237E26B0006 for ; Wed, 17 Feb 2021 11:24:22 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DE0209089 for ; Wed, 17 Feb 2021 16:24:21 +0000 (UTC) X-FDA: 77828282322.26.BD1D1DC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf12.hostedemail.com (Postfix) with ESMTP id F30E2132 for ; Wed, 17 Feb 2021 16:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613579060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fqY3aX+LcVTJX1gt4GvTFj3mpGHf8hCtl9l3H4cgEMs=; b=bhhQeOko8HkD7Jo/+LpuRBUUkdsFCk1nrHPuJCYP53TQe4JeleIt2KaTwT/oo+qFMEFFb7 e677WRrLah8KYQWG7QlXRYF2ebreGVRhpJ3v3QwSxjCsvyxYidUTN5+apSnnrtFodbfQ/m FzQbxtthX9vpiEYMebk23KRsL4vDah8= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-69-wzuwo5FYMzuuBnvq-8_GEg-1; Wed, 17 Feb 2021 11:24:18 -0500 X-MC-Unique: wzuwo5FYMzuuBnvq-8_GEg-1 Received: by mail-qt1-f199.google.com with SMTP id o7so10480858qtw.7 for ; Wed, 17 Feb 2021 08:24:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fqY3aX+LcVTJX1gt4GvTFj3mpGHf8hCtl9l3H4cgEMs=; b=BFCQr6eGqmXLw3LT2b/1qlaz15Of5X+W/nqT/6oPapfVZXdLHdB6Cd4DmfFxY4nXjy zw8p3mYPT3I0omFp2xgnYsDfPuZBmilJi08JZV1ToqW04gEdF2gLLl3VZzOqJkQUP0TB mnD2uZZxbdzsQQXeUgLK5wiMiDXxBWTR/Tq3mobX+zU3mxJe9kbz408eKLo3BL4p0XiJ utGqVdCxtmhrK7Vilz7rXpRkT6b7kdsJTwzx4KLqefgt+HHJGXVY/e+TscaWs4gLSBCW h/jo2NvoMcxuF+WShn7hipNqW+Cb3leZQ4vdcTPBOj9AiL0t2PamclhJLHCa6OxGU/zA ZHpg== X-Gm-Message-State: AOAM531H8bDg5HtT1YLBbdTiZ0osUS8qvKwdRJtPVSrwNGoMYBhiKMHu 1U/UxPRyCilBJ7LxOOY1JQNpgqN7os2ghG1XUG0fZR7t2DCVYHmhtZxt72jy44q0SJ5H5fzPD9b Ee/0Ww/QSZd0= X-Received: by 2002:ac8:59d6:: with SMTP id f22mr61291qtf.230.1613579058312; Wed, 17 Feb 2021 08:24:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzn9Qa0Y9o7twQrPMgLfwghwwaSijFXNhNL1AlkR44bHdaMQ3yXomUNjdjOPLlg9C3gTJHwAQ== X-Received: by 2002:ac8:59d6:: with SMTP id f22mr61266qtf.230.1613579058053; Wed, 17 Feb 2021 08:24:18 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id k129sm1919411qkf.108.2021.02.17.08.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 08:24:17 -0800 (PST) Date: Wed, 17 Feb 2021 11:24:15 -0500 From: Peter Xu To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, shu wang , Axel Rasmussen , Andrea Arcangeli , Heiko Carstens , Alexey Dobriyan , Matthew Wilcox , Michel Lespinasse , Andrew Morton Subject: Re: [RFC PATCH 1/5] hugetlb: add hugetlb helpers for soft dirty support Message-ID: <20210217162415.GA6519@xz-x1> References: <20210211000322.159437-1-mike.kravetz@oracle.com> <20210211000322.159437-2-mike.kravetz@oracle.com> MIME-Version: 1.0 In-Reply-To: <20210211000322.159437-2-mike.kravetz@oracle.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F30E2132 X-Stat-Signature: wxtin5t19xn9iwsqj8saiu89687k8e4q Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf12; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613579057-524993 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: On Wed, Feb 10, 2021 at 04:03:18PM -0800, Mike Kravetz wrote: > Add interfaces to set and clear soft dirty in hugetlb ptes. Make > hugetlb interfaces needed for /proc clear_refs available outside > hugetlb.c. > > arch/s390 has it's own version of most routines in asm-generic/hugetlb.h, > so add new routines there as well. > > Signed-off-by: Mike Kravetz > --- > arch/s390/include/asm/hugetlb.h | 30 ++++++++++++++++++++++++++++++ > include/asm-generic/hugetlb.h | 30 ++++++++++++++++++++++++++++++ > include/linux/hugetlb.h | 1 + > mm/hugetlb.c | 10 +--------- > 4 files changed, 62 insertions(+), 9 deletions(-) > > diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h > index 60f9241e5e4a..b7d26248fb1c 100644 > --- a/arch/s390/include/asm/hugetlb.h > +++ b/arch/s390/include/asm/hugetlb.h > @@ -105,6 +105,11 @@ static inline pte_t huge_pte_mkdirty(pte_t pte) > return pte_mkdirty(pte); > } > > +static inline pte_t huge_pte_mkyoung(pte_t pte) > +{ > + return pte_mkyoung(pte); > +} > + > static inline pte_t huge_pte_wrprotect(pte_t pte) > { > return pte_wrprotect(pte); > @@ -115,9 +120,34 @@ static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot) > return pte_modify(pte, newprot); > } > > +static inline bool huge_pte_soft_dirty(pte_t pte) > +{ > + return pte_soft_dirty(pte); > +} > + > +static inline pte_t huge_pte_clear_soft_dirty(pte_t pte) > +{ > + return pte_clear_soft_dirty(pte); > +} > + > +static inline pte_t huge_pte_swp_clear_soft_dirty(pte_t pte) > +{ > + return pte_swp_clear_soft_dirty(pte); > +} > + Indeed asm/hugetlb.h of s390 didn't include asm-generic/hugetlb.h as what was normally done by asm/hugetlb.h of other archs. Do you know why it's special? E.g. huge_pte_wrprotect() of s390 version is actually the same of the default version. When I looked at the huge_pte_wrprotect() I also see that there seems to have no real user of __HAVE_ARCH_HUGE_PTE_WRPROTECT. Not sure whether it can be dropped. My gut feeling is that s390 should also include asm-generic/hugetlb.h but only redefine the helper only if necessary, since I see no point defining the same helper multiple times. > static inline bool gigantic_page_runtime_supported(void) > { > return true; > } > > +#if !defined(__HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE) && !defined(MODULE) > +#include > + > +static inline void flush_hugetlb_tlb_range(struct vm_area_struct *vma, > + unsigned long start, unsigned long end) > +{ > + flush_tlb_range(vma, start, end); > +} > +#endif Similar question here, only ppc defined __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE, so IIUC it means s390 should simply use the default version, and it'll be great if we don't need to redefine it here. Thanks, -- Peter Xu