Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3047589imm; Sun, 3 Jun 2018 18:19:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIrHhO4l1c2T3v8e6K1n2NXJxpdtiWBx6cdE/WezCfWzJ+ICisjuaQmWlHEF/T7LpDKkcvo X-Received: by 2002:a17:902:8348:: with SMTP id z8-v6mr3406207pln.239.1528075194850; Sun, 03 Jun 2018 18:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528075194; cv=none; d=google.com; s=arc-20160816; b=ZBpj6TRI65Uf/2UHG8ufAwnoHfbBjEz5mKU8fXI3gJ0OLGYnG5OF1gSCPHiVE//A8X DmsiiGnOoDXyfs3OO61WihPoULl59uPFPsyc9fckBfFXbiI0+KXpejNoECRsP0yOYAgx uptWiafy5WhPMKOGDeelqp2D1DkI1NeMuho9uYsL49AnQYi8CNzq9ssFQ7CFD+3hsNKp 1mfOaBgwj+a1aOS74v4gdA/u31T2mFawnSXDu3WgsKMZOTYlsbIpp8Z3IBH7AJwVsh2+ TAeIFJjiAGPvBXvxdv1ghNpBZvt3mNEIF9IIwb+Z+mx6phtOxGypoSTqgN2JeMTzcp53 LuhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=o3Mh+jlxDifUU5tDqrePMKv2ru9/HroahG37nDgnvFs=; b=z5lHEcvegYB0yJz8BP+Fg4FbYfaE72NkxUPmO/g8rPaAmGjI/0UA2abUfKK9ZRjqRg y3HK8yS26t8XLqIrxkLC/R9bnhMuxVjV4xAzT3txhdsAc792aKT3Knq6UVoggZUDODFH Bn1oNuE6eQF8b7vaSAb0DKUkvGuttjG32lVd8J//8GhOSBE5HWXAFFd3tTlLfSRibXVi gP2XK093hUXCay3tFEb2fwmgCwmHYZmommNurSQUjU36f10Zvy0dsOyN3UqWzajx9puA SSHBOUfmraD8R5WPSVvJ0OmQxp/QSJAFi3a0OHHsIwjMyLcuM6fz4VVWJF1dErm3q8QK byfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@herbertland-com.20150623.gappssmtp.com header.s=20150623 header.b=t58pnTm8; 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 y12-v6si44724431plt.233.2018.06.03.18.19.31; Sun, 03 Jun 2018 18:19:54 -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=pass header.i=@herbertland-com.20150623.gappssmtp.com header.s=20150623 header.b=t58pnTm8; 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 S1751775AbeFDBS6 (ORCPT + 99 others); Sun, 3 Jun 2018 21:18:58 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:35656 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751620AbeFDBS5 (ORCPT ); Sun, 3 Jun 2018 21:18:57 -0400 Received: by mail-qk0-f194.google.com with SMTP id d130-v6so18558830qkc.2 for ; Sun, 03 Jun 2018 18:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=o3Mh+jlxDifUU5tDqrePMKv2ru9/HroahG37nDgnvFs=; b=t58pnTm8RF7o5K3WadF+F/IXawYpW5PLi1tH91u45bP1H+96bHYYaT7tOyr8yr+sav wWUgexD5mfgmhA8qAR4rDJvz3XJYi7i8fjIc0DXtuy65kaZairjBoMTv3rFYtGmcQWSd rBkW4HsyCRlsg6uBOQnfFqqvivqsc4tXyl5zpBBixhum8HgERGxr4CzoBWZ+J4zp5nXL cLVTnOgFWrhtD5ilkmEQmecJDECNFroeHROHZ3SOhLgoi2B00TAEyfzGE5jF7CMKTj7G LFY3p2Jovjjzc3Qt4WN9ONhFl/b4x//g36YO4Pfvo3RneOMhegPAO/zpX8BrZ+GaPpT/ Rfug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=o3Mh+jlxDifUU5tDqrePMKv2ru9/HroahG37nDgnvFs=; b=JYApbzKVS+j2r0LXlYkgoD5QP7NsT8NiIWydK6oi/z1krZwuypr59YfSk0pcXcs3C6 xd2etV+ZxC6DkcEa5IyrASda4vxM4osVAMh3CoREUxQzfZKdcxJM2YOnMYJiBRpQ0+s8 xXnHG8rxF3HVKSb+IoolZ5ex41O61XkxmkzfA2VHxfzfRpp/M8vCiB8hi0gQxqFHv+8l ElvfiwFXvxnTy2hdH6XDbFeZzxucnfvacRya5c0qrmMks8yLY31HVPmu94v6a9uFH3ir Uaudeo2n2aFOSNLymje6yhcErnsBW8jWMIt0FZIx/gVFKQDMFOPiOKR54srPjCueLCGA wg/w== X-Gm-Message-State: APt69E0rdEFEtdnZgqPXIqiZJoQqGg5tBy4BTnxbzfYPmN6M/dCYz5z2 EG1Tbt0Yls3XkwEF4hRf7qMwAy6kIb2I801vzz4Ywg== X-Received: by 2002:a37:1fd0:: with SMTP id n77-v6mr17011769qkh.391.1528075136321; Sun, 03 Jun 2018 18:18:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:33a2:0:0:0:0:0 with HTTP; Sun, 3 Jun 2018 18:18:55 -0700 (PDT) In-Reply-To: <87y3fvpf40.fsf@notabene.neil.brown.name> References: <152782754287.30340.4395718227884933670.stgit@noble> <152782824964.30340.6329146982899668633.stgit@noble> <20180602154851.pfy4wryezuhxp76v@gondor.apana.org.au> <87y3fvpf40.fsf@notabene.neil.brown.name> From: Tom Herbert Date: Sun, 3 Jun 2018 18:18:55 -0700 Message-ID: Subject: Re: [PATCH 10/18] rhashtable: remove rhashtable_walk_peek() To: NeilBrown Cc: Herbert Xu , Thomas Graf , Linux Kernel Network Developers , LKML , Tom Herbert Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 3, 2018 at 5:30 PM, NeilBrown wrote: > On Sat, Jun 02 2018, Herbert Xu wrote: > >> On Fri, Jun 01, 2018 at 02:44:09PM +1000, NeilBrown wrote: >>> This function has a somewhat confused behavior that is not properly >>> described by the documentation. >>> Sometimes is returns the previous object, sometimes it returns the >>> next one. >>> Sometimes it changes the iterator, sometimes it doesn't. >>> >>> This function is not currently used and is not worth keeping, so >>> remove it. >>> >>> A future patch will introduce a new function with a >>> simpler interface which can meet the same need that >>> this was added for. >>> >>> Signed-off-by: NeilBrown >> >> Please keep Tom Herbert in the loop. IIRC he had an issue with >> this patch. > > Yes you are right - sorry for forgetting to add Tom. > > My understanding of where this issue stands is that Tom raised issue and > asked for clarification, I replied, nothing further happened. > > It summary, my position is that: > - most users of my new rhashtable_walk_prev() will use it like > rhasthable_talk_prev() ?: rhashtable_walk_next() > which is close to what rhashtable_walk_peek() does > - I know of no use-case that could not be solved if we only had > the combined operation > - BUT it is hard to document the combined operation, as it really > does two things. If it is hard to document, then it might be > hard to understand. > > So provide the most understandable/maintainable solution, I think > we should provide rhashtable_walk_prev() as a separate interface. > I'm still missing why requiring two API operations instead of one is simpler or easier to document. Also, I disagree that rhashtable_walk_peek does two things-- it just does one which is to return the current element in the walk without advancing to the next one. The fact that the iterator may or may not move is immaterial in the API, that is an implementation detail. In fact, it's conceivable that we might completely reimplement this someday such that the iterator works completely differently implementation semantics but the API doesn't change. Also the naming in your proposal is confusing, we'd have operations to get the previous, and the next next object-- so the user may ask where's the API to get the current object in the walk? The idea that we get it by first trying to get the previous object, and then if that fails getting the next object seems counterintuitive. Tom Tom > Thanks, > NeilBronw