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=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 A13A4C433DF for ; Wed, 14 Oct 2020 20:56:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DFB2822254 for ; Wed, 14 Oct 2020 20:56:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="MuanJBZW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFB2822254 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 19A6E6B005D; Wed, 14 Oct 2020 16:56:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14BD0900002; Wed, 14 Oct 2020 16:56:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 012486B0068; Wed, 14 Oct 2020 16:56:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id C82336B005D for ; Wed, 14 Oct 2020 16:56:21 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 66DAD3626 for ; Wed, 14 Oct 2020 20:56:21 +0000 (UTC) X-FDA: 77371738962.19.print28_23009842720e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 4603A1AD1B5 for ; Wed, 14 Oct 2020 20:56:21 +0000 (UTC) X-HE-Tag: print28_23009842720e X-Filterd-Recvd-Size: 5391 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Wed, 14 Oct 2020 20:56:20 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09EKsKUh005403; Wed, 14 Oct 2020 20:56:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=2dHm09Cd/t0EY1pFGezYnD8/lE5PJwJ2i8unZaqVKkw=; b=MuanJBZWoZVWBkFAYPnavkgtao047Y/tIwxSOlrITqcuNtNrilkva0w4zlao5qpjJxNO wxhqPOE1jzBdzhShh9zLyGBBtqTHbnCT6j8JEFApLFDXncxLcJr/JF9lwarXdDgi4WT4 CrA8m4JNPMQnfZd/llCDS/Wm7IP4E2UtiFsvk7yiy3zEVC0GVoZ2CZYhoHMCZ8zTbNNc zIabnreO8UggVCicu2PntN4YAr8y1LANyZSJdbGSzXq4/8MKWCoxn83upAPz7UmoKeT7 wTszyg2WFygjXZa1/Gh4LK6cm6cygPABXQmvDly0lFM2gQRDRnaCecc7ZUtsq6t9nn4h ng== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 3434wksru3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Oct 2020 20:56:11 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09EKnZiO079912; Wed, 14 Oct 2020 20:54:10 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 344by46q0x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Oct 2020 20:54:10 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09EKs2fJ006933; Wed, 14 Oct 2020 20:54:02 GMT Received: from [10.159.149.68] (/10.159.149.68) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Oct 2020 13:54:02 -0700 Subject: Re: [PATCH 5/8] x86/clear_page: add clear_page_uncached() To: Andy Lutomirski Cc: LKML , Linux-MM , "Kirill A. Shutemov" , Michal Hocko , Boris Ostrovsky , Konrad Rzeszutek Wilk , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , "H. Peter Anvin" , Arnd Bergmann , Andrew Morton , Ira Weiny , linux-arch References: <20201014083300.19077-1-ankur.a.arora@oracle.com> <20201014083300.19077-6-ankur.a.arora@oracle.com> From: Ankur Arora Message-ID: <047e8a34-65cb-ce46-bfe2-014a43b61560@oracle.com> Date: Wed, 14 Oct 2020 13:54:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=928 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140146 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 impostorscore=0 clxscore=1011 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=949 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010140147 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 2020-10-14 8:45 a.m., Andy Lutomirski wrote: > On Wed, Oct 14, 2020 at 1:33 AM Ankur Arora wrote: >> >> Define clear_page_uncached() as an alternative_call() to clear_page_nt() >> if the CPU sets X86_FEATURE_NT_GOOD and fallback to clear_page() if it >> doesn't. >> >> Similarly define clear_page_uncached_flush() which provides an SFENCE >> if the CPU sets X86_FEATURE_NT_GOOD. > > As long as you keep "NT" or "MOVNTI" in the names and keep functions > in arch/x86, I think it's reasonable to expect that callers understand > that MOVNTI has bizarre memory ordering rules. But once you give > something a generic name like "clear_page_uncached" and stick it in > generic code, I think the semantics should be more obvious. > > How about: > > clear_page_uncached_unordered() or clear_page_uncached_incoherent() > > and > > flush_after_clear_page_uncached() > > After all, a naive reader might expect "uncached" to imply "caches are > off and this is coherent with everything". And the results of getting > this wrong will be subtle and possibly hard-to-reproduce corruption. Yeah, these are a lot more obvious. Thanks. Will fix. Ankur > > --Andy >