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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 030BBC18E5B for ; Mon, 16 Mar 2020 09:21:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C238B20674 for ; Mon, 16 Mar 2020 09:21:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C238B20674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B0AA6B0005; Mon, 16 Mar 2020 05:21:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 661006B0007; Mon, 16 Mar 2020 05:21:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54F986B0008; Mon, 16 Mar 2020 05:21:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id 3EB2A6B0005 for ; Mon, 16 Mar 2020 05:21:49 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 08028181AEF1A for ; Mon, 16 Mar 2020 09:21:49 +0000 (UTC) X-FDA: 76600683138.17.sugar77_4a02ca7e49052 X-HE-Tag: sugar77_4a02ca7e49052 X-Filterd-Recvd-Size: 3609 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 09:21:48 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C9F4DAFCA; Mon, 16 Mar 2020 09:21:46 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 9165F1E10DA; Mon, 16 Mar 2020 10:21:46 +0100 (CET) Date: Mon, 16 Mar 2020 10:21:46 +0100 From: Jan Kara To: Matthew Wilcox Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/8] xarray: Provide xas_erase() helper Message-ID: <20200316092146.GB12783@quack2.suse.cz> References: <20200204142514.15826-1-jack@suse.cz> <20200204142514.15826-3-jack@suse.cz> <20200314195453.GS22433@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200314195453.GS22433@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat 14-03-20 12:54:53, Matthew Wilcox wrote: > On Tue, Feb 04, 2020 at 03:25:08PM +0100, Jan Kara wrote: > > Currently xas_store() clears marks when stored value is NULL. This is > > somewhat counter-intuitive and also causes measurable performance impact > > when mark clearing is not needed (e.g. because marks are already clear). > > So provide xas_erase() helper (similarly to existing xa_erase()) which > > stores NULL at given index and also takes care of clearing marks. Use > > this helper from __xa_erase() and item_kill_tree() in tools/testing. In > > the following patches, callers that use the mark-clearing property of > > xas_store() will be converted to xas_erase() and remaining users can > > enjoy better performance. > > I (finally!) figured out what I don't like about this series. You're > changing the semantics of xas_store() without changing the name, so > if we have any new users in flight they'll use the new semantics when > they're expecting the old. > > Further, while you've split the patches nicely for review, they're not > good for bisection because the semantic change comes right at the end > of the series, so any problem due to this series is going to bisect to > the end, and not tell us anything useful. OK, fair enough. > What I think this series should do instead is: > > Patch 1: > +#define xas_store(xas, entry) xas_erase(xas, entry) > -void *xas_store(struct xa_state *xas, void *entry) > +void *__xas_store(struct xa_state *xas, void *entry) > - if (!entry) > - xas_init_marks(xas); > +void *xas_erase(struct xa_state *xas, void *entry) > +{ > + xas_init_marks(xas); > + return __xas_store(xas, entry); > +} > (also documentation changes) > > Patches 2-n: > Change each user of xas_store() to either xas_erase() or __xas_store() > > Patch n+1: > -#define xas_store(xas, entry) xas_erase(xas, entry) > > Does that make sense? I'll code it up next week unless you want to. Fine by me and I agree the change is going to be more robust this way. I just slightly dislike that you end up with __xas_store() with two underscores which won't have a good meaning after the series is done but I can certainly live with that :). If you've time to reorganize the series this week, then go ahead. I've just returned from a week of vacation so it will take a while for me to catch up... Thanks for having a look! Honza -- Jan Kara SUSE Labs, CR