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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 40949C33CAC for ; Thu, 6 Feb 2020 03:52:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0302420720 for ; Thu, 6 Feb 2020 03:52:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="pILzBx3v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0302420720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9FD7F6B0003; Wed, 5 Feb 2020 22:52:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9ACB76B0006; Wed, 5 Feb 2020 22:52:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C1746B0007; Wed, 5 Feb 2020 22:52:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 7583D6B0003 for ; Wed, 5 Feb 2020 22:52:00 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1930D248E for ; Thu, 6 Feb 2020 03:52:00 +0000 (UTC) X-FDA: 76458328800.12.steam21_11646cdf44935 X-HE-Tag: steam21_11646cdf44935 X-Filterd-Recvd-Size: 4390 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Feb 2020 03:51:59 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 05 Feb 2020 19:50:59 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 05 Feb 2020 19:51:57 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 05 Feb 2020 19:51:57 -0800 Received: from [10.2.168.158] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 6 Feb 2020 03:51:57 +0000 Subject: Re: [PATCH 8/8] xarray: Don't clear marks in xas_store() To: Matthew Wilcox CC: Jan Kara , , References: <20200204142514.15826-1-jack@suse.cz> <20200204142514.15826-9-jack@suse.cz> <8ea2682b-7240-dca3-b123-2df7d0c994ba@nvidia.com> <20200206022144.GU8731@bombadil.infradead.org> From: John Hubbard X-Nvconfidentiality: public Message-ID: <01e577b2-3349-15bc-32c7-b556e9f08536@nvidia.com> Date: Wed, 5 Feb 2020 19:48:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200206022144.GU8731@bombadil.infradead.org> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1580961059; bh=XssupI12QibVhDkrch/+dRXC2gZu6nYcUffAkr8ShLs=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=pILzBx3vzqkRVHivaNss9EGE4J2yb/Rf7wllGG5vAhir+ennQoC3K03UJ5icXJxWt Da4bcU2MpZzSdDck7FTUw/t7zPLGKqLupo/g3G4FmQAah76MBZNpVuJnPW/r93Q8Wm kDHgpMNXLA/E7SfNqt1YjjCU3eNqkp4Qdal3RJM4gWqfYeW7AIKWs6B4iy5/BCOv2o 0yWVWMYgSyZByXBB/lLRcVEky70xHmLzjovqDED5kW8jtxHyXzN8qxxU1cWERUvA+O jvC9Y7b+tc3RjC1CQwMfy1VpxBMKIBad7GWFR43GkKhU91uIACxz8+/Lsx1XCAkTxs 0V3GV5Vp5LSdg== 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 2/5/20 6:21 PM, Matthew Wilcox wrote: > On Wed, Feb 05, 2020 at 02:19:34PM -0800, John Hubbard wrote: >> So if we do this, I think we'd also want something like this (probably with >> better wording, this is just a first draft): >> >> diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst >> index 640934b6f7b4..8adeaa8c012e 100644 >> --- a/Documentation/core-api/xarray.rst >> +++ b/Documentation/core-api/xarray.rst >> @@ -66,10 +66,11 @@ pointer at every index. >> You can then set entries using xa_store() and get entries >> using xa_load(). xa_store will overwrite any entry with the >> new entry and return the previous entry stored at that index. You can >> -use xa_erase() instead of calling xa_store() with a >> +use xa_erase() plus xas_init_marks(), instead of calling xa_store() with a > > Woah, woah, woah. xa_erase() re-initialises the marks. Nobody's going Yes, I get that. But I mis-wrote it, it should have read more like: You can then set entries using xa_store() and get entries using xa_load(). xa_store will overwrite any entry with the new entry and return the previous entry stored at that index. You can use xa_erase(), instead of calling xa_store() with a ``NULL`` entry followed by xas_init_marks(). There is no difference between an entry that has never been stored to and one that has been erased. Those, in turn, are the same as an entry that has had ``NULL`` stored to it and also had its marks erased via xas_init_marks(). > to change that. Don't confuse the porcelain and plumbing APIs. > The API still documents a different behavior than this patchset changes it to, despite my imperfect attempts to update the documentation. So let's please keep the porcelain aligned with the plumbing. :) thanks, -- John Hubbard NVIDIA