Received: by 10.213.65.68 with SMTP id h4csp1096248imn; Tue, 27 Mar 2018 14:52:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+GYa+vC8ShJzDgJbjCjv2IHcRxAZ4B93AW838jrz5LwBP2iAfa0EroQse95Dghyv1RkgL/ X-Received: by 10.98.217.88 with SMTP id s85mr288666pfg.20.1522187563099; Tue, 27 Mar 2018 14:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522187563; cv=none; d=google.com; s=arc-20160816; b=vyPYq2NQBzVQrQtbCCKWI0Ky4OtDmv8VeTGc4zlU+ELCesXz4mE4jlViiESIsvBreF FzA6ig6njrEhr57Fuqf3E3n74ZmfSphspBVYdTc8yjGMYzES6sBfC+qJrVKc62sbFlXt YgTnQW87BQxG2iKCLkyqwzkFZ7VL3aNCgEFy1TDqKaoIdTpH1s78Sa27aeMNp4r4rAJ0 8xFNAbxUBEIeM+9YBTqSYdKJ9HvlqV89a3krxYdsJ4gqQ9yp3ObEhAIsotcZ4dXYsS6x 8fZx2xqk1nvLCPuyJzHN1CeFP/ICX6UfDxeZfdcSxVO5UCIZiXifvouF18t30VJdOiiU DQbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:references :in-reply-to:subject:cc:date:to:from:arc-authentication-results; bh=XFNHSsSYLOlIOyLvNh5rKPDNz2pFOB22fDJ2UYrBBzc=; b=ie6W9qB4amA7glttoGMSIU/Ni9rAKCLxhzE4evXVE+UX4fApaeK47einQO0oxbRj0p cc7+bfpR4wHzb0hlFkaIqhgoQ43W89xe96uJ+imkA622XtO48ywbvIrmGI+64u4NvURl JFQTaek6FJcVG3uWksZcvs93VfMRB4kg6jwm/ru1O06wwd29XJfLrTFSeXZtW3eJBqD2 AX2v5IpqccgRzXmqreRTitUKFdqMA/PrafWqQxDUEFfXuIngIVVcFjesTEaQR6xJSmIV 1Xo/L9u9GM9NO8qKPi1Ungmlfr9hKT49zxZxLlZRYm+2aYro1rNdOCoNYoUUc/3nTdnt rDtw== ARC-Authentication-Results: i=1; mx.google.com; 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 m11-v6si2159903pla.724.2018.03.27.14.52.28; Tue, 27 Mar 2018 14:52:43 -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; 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 S1752125AbeC0Vup (ORCPT + 99 others); Tue, 27 Mar 2018 17:50:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:56567 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbeC0Vuo (ORCPT ); Tue, 27 Mar 2018 17:50:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9A312AF26; Tue, 27 Mar 2018 21:50:42 +0000 (UTC) From: NeilBrown To: David Miller Date: Wed, 28 Mar 2018 08:50:31 +1100 Cc: tgraf@suug.ch, herbert@gondor.apana.org.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects. In-Reply-To: <20180327.114941.997071660018188736.davem@davemloft.net> References: <152210688405.11435.13010923693146415942.stgit@noble> <152210718430.11435.5761213978298714527.stgit@noble> <20180327.114941.997071660018188736.davem@davemloft.net> Message-ID: <87sh8l428o.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain On Tue, Mar 27 2018, David Miller wrote: > From: NeilBrown > Date: Tue, 27 Mar 2018 10:33:04 +1100 > >> In many cases where the walker needs to drop out of RCU protection, >> it will take a reference to the object and this can prevent it from >> being removed from the hash table. In those cases, the last-returned >> object can still be used as a cursor. rhashtable cannot detect >> these cases itself. > > Merely having an elevated reference count does not explicitly prevent > the object from being removed from the hash table. > > This invariant might hold for the particular user of the rhashtable > instance, but it is not always the case. Agreed. Hence "In many case ... this *can* be prevented" and "In those cases". The doc comment for rhashtable_walk_start_continue() makes it clear that: * The * previously returned object must still be in the hash table, and must be * provided as an argument. Thanks, NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlq6vKgACgkQOeye3VZi gbnObw//fCvvgRZAV5Jq3DOSU7zZqrD7cn1CgGYgnkAu8lVTS9hga1/HqJ3hMLPv LmhC8E24L8KjfgQi7GN7Q/4/+Or6/jAMY+TgO2KXJatEJl7FrMHIEnx6RTXCSEOI z18dwBsRsZ/5H1EnjPeL5Yju8/P8dP82AAEZmrKDG5xHx4fyCzv7/q++Yxkl5dWq 3imE6lxu7zmv0h1drH88mK3XrIgKDARacuman7Gm4yfL08LPUxZnXVBRMhaiuI5m wIpwjheDfdcjGaRqUVUYXqA2TfgpJiWQbaSrjyQS3xxolCY6lTy6FNqzSXNRGFQl CEPxUEiSdZNO3eg5hU332orWnN3cCzk9SlcK38URVdrs6q9s8wRGMMGqLG8OWsts P+h73Rp66uxT1r84jt2C5tRr+jhhllDO3/O7gMz5xTXGsz3XkCMLYCl5vbAONl7s tMm6FXD2H3b+gFl7LfmVhISaCpRB1FwsUEgOgDeF1bGmHnWsHC55AQ9QeTP6T276 UwGK7e+Dc03pcnI7g5n68+blyR13NgaMNqP39Jw8IBWJ26weTrctU3zvS1WCS4pj DBfQCn52sclgmLHdvel72tMEQGP98YAwJifkVzGlgDjU2df+g4v8D8pjO96moz8j eOSjz9j0rcw+4Hx5oXxhYYzAVi4gMEQ2i9+yE4sLL4f9Tf3w7MA= =2HhT -----END PGP SIGNATURE----- --=-=-=--