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.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 8C6FEC3F68F for ; Thu, 6 Feb 2020 14:49:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4F357214AF for ; Thu, 6 Feb 2020 14:49:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ieV6ok88" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F357214AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C076A6B0007; Thu, 6 Feb 2020 09:49:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB7036B0008; Thu, 6 Feb 2020 09:49:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA5BE6B000A; Thu, 6 Feb 2020 09:49:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 8ECA16B0007 for ; Thu, 6 Feb 2020 09:49:12 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 42F10180AD802 for ; Thu, 6 Feb 2020 14:49:12 +0000 (UTC) X-FDA: 76459984944.07.spoon24_504e86f85db0e X-HE-Tag: spoon24_504e86f85db0e X-Filterd-Recvd-Size: 4384 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Feb 2020 14:49:11 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id n184so967437qkn.1 for ; Thu, 06 Feb 2020 06:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zJQnayg2t9HyzLdxg1/cTyDc+GhjfYN6AXv+5xX69wE=; b=ieV6ok887c2F2Q37B0Vs/T02DJAZZcWD4kKAITWhFRJBzU9zD4fBdyOHYhFshgnd2X mtQSUTQ4WyFmXpfVlBhWPc6sEpA7Owctef5O4VdScbMRViqIzj1/lNjm4z1xw3qBZKZU HT5kRPnInU2LA/Emeb7dXXnKZZlor7LkhlIQYcXwsdylT0Io18FiNHTIq59yjlqbodk6 C9FtnaWNgEjqFqXc7KEkT45zerbRrFJDfMHcpa60ZKbkhJoLpXYqVbyfcHAxOnG6Qs0B yOFWG0sXcOcoZmmOW/Ielm+jdIMGIeLHUSJ3oQfLb1jahz7vJFxx6SLZsvalm/mGHjNv jQcQ== 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:user-agent; bh=zJQnayg2t9HyzLdxg1/cTyDc+GhjfYN6AXv+5xX69wE=; b=raFSJoX5ts9s++LtO6hYivkKu08iCShLiJ3iX/4veLbxNywLv42m2HrVoIIk10MZNE +7yCuU88vOKrpijyfhMLC8w4t/wCwKduaoF6mcMHmllfY3wAe0sdfrzvbf+L2TOHrEJ9 GTg8QEgvSCvLdU9jsz5/WiAqHNU7u6DudOjBWs3N8X+7I4cp5oXseEWSIqv2qJuqeSg6 NwWOF4ydVRjn7Iq0+lXPRsQ08G/KK9S4Btximk/clp6C3RA1IHlH4UUzNY44QpfYBWfy ZT6nUveRVUbECFzU7wRORdUl/vRp6dZVU8JDHciWyparnRt6YozZU+wIDS3YNU8k7SHn Jxmg== X-Gm-Message-State: APjAAAVSH9U7Ndu7IcZ8xlTCvTR0n+j71Ux7MoaI+w53jEbooTXHid0G VHKcdKqLQXu4S/MFBZrONqeuSQ== X-Google-Smtp-Source: APXvYqzl17RYyuUw116o46PwQutXSqSIbFwrWw1az9DYbQsBJA9hxWHyfEgOgpEuEGbHVCBOW/B/jw== X-Received: by 2002:a05:620a:22f3:: with SMTP id p19mr2706428qki.200.1581000551158; Thu, 06 Feb 2020 06:49:11 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id c186sm1493820qke.124.2020.02.06.06.49.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Feb 2020 06:49:10 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iziSs-0006Au-0h; Thu, 06 Feb 2020 10:49:10 -0400 Date: Thu, 6 Feb 2020 10:49:10 -0400 From: Jason Gunthorpe To: Jan Kara Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 8/8] xarray: Don't clear marks in xas_store() Message-ID: <20200206144909.GH25297@ziepe.ca> References: <20200204142514.15826-1-jack@suse.cz> <20200204142514.15826-9-jack@suse.cz> <20200205184344.GB28298@ziepe.ca> <20200205215904.GT8731@bombadil.infradead.org> <20200206134904.GD25297@ziepe.ca> <20200206143627.GA26114@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206143627.GA26114@quack2.suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) 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 Thu, Feb 06, 2020 at 03:36:27PM +0100, Jan Kara wrote: > Yeah, that's why I'd prefer if NULL was not "special value" at all and if > someone wanted to remove index from xarray he'd always have to use a > special function. My patches go towards that direction but not the full way > because there's still xa_cmpxchg() whose users use the fact that NULL is in > fact 'erase'. IMHO, this is more appealing. The fact that xa_store(NULL) on non-allocating arrays changes marks seems very surprising/counter intuitive. It feels wise to avoid subtle differences like this between allocating/non-allocating mode. So, it would be more uniform if xa_store and xa_cmpxchg never altered marks. I suppose in practice this means that xa_store(NULL) has to store a XA_ZERO_ENTRY even for non-allocating arrays, and related. Perhaps xa_cmp_erase() could be introduced to take the place of cmpxchg(NULL), and the distinction between erase and store NULL is that erase has the mark-destroying property and guarentees the tree can be pruned. Jason