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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 47C62C433E2 for ; Wed, 9 Sep 2020 10:27:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 996AE21D91 for ; Wed, 9 Sep 2020 10:27:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="RrZs/nyX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 996AE21D91 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A78666B0002; Wed, 9 Sep 2020 06:27:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A28DD8E0001; Wed, 9 Sep 2020 06:27:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EFF26B0055; Wed, 9 Sep 2020 06:27:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 775DF6B0002 for ; Wed, 9 Sep 2020 06:27:33 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3A29F33CD for ; Wed, 9 Sep 2020 10:27:33 +0000 (UTC) X-FDA: 77243146386.03.men09_5c0a451270dc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 12EAA28A4E8 for ; Wed, 9 Sep 2020 10:27:33 +0000 (UTC) X-HE-Tag: men09_5c0a451270dc X-Filterd-Recvd-Size: 5675 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Sep 2020 10:27:32 +0000 (UTC) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 089A2ZCv195896; Wed, 9 Sep 2020 06:27:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type; s=pp1; bh=YEpZ1XyTfdUWIVWwW3Ff4Nf6q12vIx7sVHOKBnj6u8g=; b=RrZs/nyXQlGRttvQhgHGbvKfOEZGoDCilws/V+4CwBDa44UhPDRAaxyY3jjivUF5MXjG /UTt3JbpYT1z3iOXfBkMc33Sr+MyuWVhywIJ5++70gLu30j1DNFnGFTkYTOsBvbHh+ZN 0wCqUQanHg1LW8vapxWNSBS+1HIuPCcCbB2vPLvrdHu3UbJXE/8r9zioC+W9NHh/C8aU +oHiIpos0DStadvKQ2TywX3i+81CE0v2IS3MUWD/JbzFVMdPjqSGiO1y8eUZndBYtDEm 9PCrsfziZ8+CtnCa06ouY37h/5vB9ImP2vPO2tbvtt/5te/dVS7V2qaIXjfXbyRq2Mp+ Uw== Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 33evv38y7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Sep 2020 06:27:07 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 089ADJ3t012978; Wed, 9 Sep 2020 10:27:06 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma03wdc.us.ibm.com with ESMTP id 33cebutt38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Sep 2020 10:27:06 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 089AR6iG60686618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Sep 2020 10:27:06 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EF3336E050; Wed, 9 Sep 2020 10:27:05 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E60D6E04E; Wed, 9 Sep 2020 10:27:01 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.85.93.29]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 9 Sep 2020 10:27:00 +0000 (GMT) X-Mailer: emacs 27.1 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Matthew Wilcox , linux-arch@vger.kernel.org Cc: Thomas Bogendoerfer , Vineet Gupta , linuxppc-dev@lists.ozlabs.org, Russell King , linux-mips@vger.kernel.org, linux-mm@kvack.org, Paul Mackerras , Catalin Marinas , sparclinux@vger.kernel.org, linux-snps-arc@lists.infradead.org, Will Deacon , "David S. Miller" , linux-arm-kernel@lists.infradead.org Subject: Re: Flushing transparent hugepages In-Reply-To: <20200818150736.GQ17456@casper.infradead.org> References: <20200818150736.GQ17456@casper.infradead.org> Date: Wed, 09 Sep 2020 15:56:58 +0530 Message-ID: <87tuw74559.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-09_03:2020-09-08,2020-09-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=521 adultscore=0 mlxscore=0 suspectscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1011 priorityscore=1501 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009090085 X-Rspamd-Queue-Id: 12EAA28A4E8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: Matthew Wilcox writes: > PowerPC has special handling of hugetlbfs pages. Well, that's what > the config option says, but actually it handles THP as well. If > the config option is enabled. > > #ifdef CONFIG_HUGETLB_PAGE > if (PageCompound(page)) { > flush_dcache_icache_hugepage(page); > return; > } > #endif I do have a change posted sometime back to avoid that confusion. http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20200320103256.229365-1-aneesh.kumar@linux.ibm.com/ But IIUC we use the head page flags (PG_arch_1) to track whether we need the flush or not. > > By the way, THPs can be mapped askew -- that is, at an offset which > means you can't use a PMD to map a PMD sized page. > > Anyway, we don't really have consensus between the various architectures > on how to handle either THPs or hugetlb pages. It's not contemplated > in Documentation/core-api/cachetlb.rst so there's no real surprise > we've diverged. > > What would you _like_ to see? Would you rather flush_dcache_page() > were called once for each subpage, or would you rather maintain > the page-needs-flushing state once per compound page? We could also > introduce flush_dcache_thp() if some architectures would prefer it one > way and one the other, although that brings into question what to do > for hugetlbfs pages. > > It might not be a bad idea to centralise the handling of all this stuff > somewhere. Sounds like the kind of thing Arnd would like to do ;-) I'll > settle for getting enough clear feedback about what the various arch > maintainers want that I can write a documentation update for cachetlb.rst.