Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1249752imm; Thu, 5 Jul 2018 18:38:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdMUURfDYDYqP9Bf+bsgys9rTRxjEZB077imXuMqxGCdS/v4EAy+bMBG9V8sSH95Z9oqfkM X-Received: by 2002:a17:902:530a:: with SMTP id b10-v6mr8510562pli.316.1530841100868; Thu, 05 Jul 2018 18:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530841100; cv=none; d=google.com; s=arc-20160816; b=lpNlcWw4g0/DkKCqay0H4X/fxXCvcGVyvtdZLyDs94iXPDlp5mJyurof8vnrBEvKEt IRPViVBMT35WrrzSCIIreXnPV8BA+6IIPFJ5X2L4lQ+Goo6fQOqOgRum9YsqRBOk+Oao aZPoKPXfWfwxkFIYochOlSVrlEKMuM+/lhkEIY66r5IOod2wkQCcLhponoeUADSLGIX0 QG0ua8Q9itu0rCxKNg40k7XRsStOjj13iinzymoHq56cXqosS9pdFmHndju7lqb2Jp5h KPuyS/yLNYHHBUWebN1L/j43CVKWwOr2WO66qXrqp8cJ818e32EqsTw56TFQE5ZqoxxL RvBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=5fOqsnfj6iqE09j0kpwKJq41zTtSndK4BWcEEPYmfN8=; b=e8As03qb66LjoutIVjrilctsCrv4g2jPt291aewrEMKx2TTWT7+bY/IGJ63hYqoGZc 2TjgZdMftFOnzyO5dmQdYZ9EqHs2OEdUKf2st5Jw5ZUQ5dV/pPXi8gVC07dAoTDRlRyz 7ew+w+aKZEPM/0ug0Dn9544VUX9b9VH8YIcgbr8NCJvCIL86N5v4Q5NM4lNicxuPYGN1 IYSshPR8sZoNoQnyRJlmupxaoZnqbbu48+5oljbr1R4pXGMUJDm3/0IDaXG510NNLyah sw4YN6BxqUfu4fSl6oIBWN8QZPw10nSho3N6fLH4f3ZI1xMJ53VjzrTCbE8aN4winZRv r8Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=wSis1HEx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8-v6si6451165pgs.211.2018.07.05.18.38.06; Thu, 05 Jul 2018 18:38:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=wSis1HEx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753801AbeGFBgU (ORCPT + 99 others); Thu, 5 Jul 2018 21:36:20 -0400 Received: from casper.infradead.org ([85.118.1.10]:44418 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753577AbeGFBgT (ORCPT ); Thu, 5 Jul 2018 21:36:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Message-ID:In-Reply-To:Subject:cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5fOqsnfj6iqE09j0kpwKJq41zTtSndK4BWcEEPYmfN8=; b=wSis1HExyMr/s4fzJU5sNJxZv gwigfkXxhDCNvDGTX3buxl2CLItXnobamTmC7iw+aCzs0Je7m+nNYJPnFaBkzr//lNiENAbEHbsQb a/x6rhJ0cqRcNK9yTKADkecJtJ7y79CC/9e3k5JgBTxgDuNhuxyGsOoXEmDgjBDA7cIzxtWm+cgoL HQHE6yPYQoROLPzfbn2vRpfU4a51Ow8BOjrWNcdbKCyOdbegczZ27ZHlq1/y5m8OJVtOwaOh7evoz +Eugqb8iveLPE1JtwAfTs1Hpt7xDBNCWrNuDo0YD/pNXtQAGJLylwGapAEK0MahXuH33bkY22s5mA 5qVMdp28g==; Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fbFfK-0005Jg-Sc; Fri, 06 Jul 2018 01:36:09 +0000 Date: Fri, 6 Jul 2018 02:36:06 +0100 (BST) From: James Simmons To: NeilBrown cc: Oleg Drokin , Andreas Dilger , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 01/11] staging: lustre: simplify use of interval-tree. In-Reply-To: <87sh5mfit7.fsf@notabene.neil.brown.name> Message-ID: References: <152826510267.16761.14361003167157833896.stgit@noble> <152826511890.16761.16115276596203531205.stgit@noble> <87sh5mfit7.fsf@notabene.neil.brown.name> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180706_023607_132699_9477DD2A X-CRM114-Status: GOOD ( 30.88 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> Lustre has a private interval-tree implementation. This > >> implementation (inexplicably) refuses to insert an interval if an > >> identical interval already exists. It is OK with all sorts of > >> overlapping intervals, but identical intervals are rejected. > > > > I talked to Oleg about this since this changes the behavior. He is worried > > about having identical items that would end up being merged. If we can > > guarantee by some other means there are no identical nodes, we are > > probably fine with the interval tree code allowing this. Oleg can explain > > better than me in this case. > > I don't think this is a change in behaviour. > In the driver/staging client code, interval tree is being used in two > places and both of them have clumsy work-arounds for the fact that they > cannot insert duplicates in the interval tree. > The patch just cleans his up. > > However if I have missed something, please provide details. > What "identical items" might get merged? Oleg could you fill in detail what your concerns are? > > > >> Both users of interval-tree in lustre would be simpler if this was not > >> the case. They need to store all intervals, even if some are > >> identical. > >> > >> llite/range_lock.c add a rl_next_lock list_head to each lock. > >> If it cannot insert a new lock because the range is in use, it > >> attached the new lock to the existing lock using rl_next_lock. > >> This requires extra code to iterate over the rl_next_lock lists when > >> iterating over locks, and to update the list when deleting a lock from > >> the tree. > >> > >> ldlm_extend allocates a separate ldlm_interval which as a list of > >> ldlm_locks which share the same interval. This is linked together > >> by over-loading the l_sl_policy which, for non-extent locks, is used > >> for linking together locks with the same policy. > >> This doesn't only require extra code, but also an extra memory > >> allocation. > >> > >> This patch removes all that complexity. > >> - interval_insert() now never fails. > > > > Its not really a failure. What it does is if it finds a already existing > > node with the range requested it returns the already existing node > > pointer. If not it just creates a new node and returns NULL. Sometimes > > identical request can happen. A good example of this is with HSM request > > on the MDS server. In that case sometimes we get identical progress > > reports which we want to filter out so not add the same data. > > This example is server-side code which is not a focus at present. > Having a quick look, it looks like it would be easy enough to do a > lookup first and then only insert if the lookup failed. > I think this is a much nicer approach than never allowing duplicates in > the interval tree. > > Thanks, > NeilBrown >