Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6274684imm; Mon, 23 Jul 2018 14:53:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeWkElsI9HalGZHRVfe8bny1rfHfwhCvAiQMJdi27U5GZD33sqU/t7KkTCqbDvumg2hxj8c X-Received: by 2002:a63:b74a:: with SMTP id w10-v6mr13689094pgt.266.1532382832531; Mon, 23 Jul 2018 14:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532382832; cv=none; d=google.com; s=arc-20160816; b=vZsytyn6g+jRqMjik2cuaiqjtX+RVZBAz7M7+r7VccjIjmJOYkbzrkgmReSWJBToN4 j3WPdJWxHHqnY2Z9Sregfv0Dd+fE8PXrCKg4P1dno11y540qDJpn3K6Mb2gIVKmbdx2q r5ZTtiS5WVg0y8P0PnsFqQBaBpdIfg0vUCEo1/zpPmaONg7yvXam1XWn0DXRGv5Fo26n UTgRmPCGRvhIPAd/NmA9Gsv2bgIMSkPAx42+KTj3xEAribHaR3SEjEGB6r0vbllISiEp CQtaZRt5AH6uATM2T7FBVPvGo6yFAK1gxXX6H9uuNumfQnFcxVyLZyulwCr8iQTe/mb4 MvrA== 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=vmjndAmL3pzQsvfPdwiu/jIcVJNd5/hFhCNQdphF35Y=; b=pgHct5D3dQuGagljhkPXTnxoJ2hiOIO95zEaOGxQ5E2CMROrQkKgNAmodPtD6KjEsA 189BC7dkmpFj5lXZnEd1BKSyuMjO89SJIUdvlZfI/uMB7qxdCiTzY8J3lLAdV8R7J+RZ /LiOkaZM1SpwiOhHBXSBTw/oNgJGRA/4I/J0AtMALTfmsg86oD/09adYjkH9VwbeFx54 n0Qkq14wmpUprKZCPz88XuziyGGoUOPtuKfGIXgO13KOsHeFCxCkfDoj+Jt+P+2RzFze XoJCaHE0TRaaLmFmg4Uq7IDT32dh9yVixMk9abarfyURR3etzcTveuHH0e8vXXgPMoWs WhHg== 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 d18-v6si8411055pgp.214.2018.07.23.14.53.37; Mon, 23 Jul 2018 14:53:52 -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 S2388199AbeGWWzZ (ORCPT + 99 others); Mon, 23 Jul 2018 18:55:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:53212 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388088AbeGWWzZ (ORCPT ); Mon, 23 Jul 2018 18:55:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9003CB034; Mon, 23 Jul 2018 21:52:11 +0000 (UTC) From: NeilBrown To: paulmck@linux.vnet.ibm.com Date: Tue, 24 Jul 2018 07:52:03 +1000 Cc: Herbert Xu , Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] rhashtable: don't hold lock on first table throughout insertion. In-Reply-To: <20180723205625.GZ12945@linux.vnet.ibm.com> References: <153086169828.24852.10332573315056854948.stgit@noble> <153086175009.24852.7782466383056542839.stgit@noble> <20180720075409.kfckhodsnvktift7@gondor.apana.org.au> <20180720144152.GW12945@linux.vnet.ibm.com> <87muulqq8q.fsf@notabene.neil.brown.name> <20180722215446.GH12945@linux.vnet.ibm.com> <87h8kqrhi0.fsf@notabene.neil.brown.name> <20180723205625.GZ12945@linux.vnet.ibm.com> Message-ID: <87r2jtpqm4.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 Content-Transfer-Encoding: quoted-printable On Mon, Jul 23 2018, Paul E. McKenney wrote: > On Mon, Jul 23, 2018 at 09:13:43AM +1000, NeilBrown wrote: >> On Sun, Jul 22 2018, Paul E. McKenney wrote: >> > >> > One issue is that the ->func pointer can legitimately be NULL while on >> > RCU's callback lists. This happens when someone invokes kfree_rcu() >> > with the rcu_head structure at the beginning of the enclosing structur= e. >> > I could add an offset to avoid this, or perhaps the kmalloc() folks >> > could be persuaded Rao Shoaib's patch moving kfree_rcu() handling to >> > the slab allocators, so that RCU only ever sees function pointers in >> > the ->func field. >> > >> > Either way, this should be hidden behind an API to allow adjustments >> > to be made if needed. Maybe something like is_after_call_rcu()? >> > This would (for example) allow debug-object checks to be used to catch >> > check-after-free bugs. >> > >> > Would something of that sort work for you? >>=20 >> Yes, if you could provide an is_after_call_rcu() API, that would >> perfectly suit my use-case. > > After beating my head against the object-debug code a bit, I have to ask > if it would be OK for you if the is_after_call_rcu() API also takes the > function that was passed to RCU. Sure. It feels a bit clumsy, but I can see it could be easier to make robust. So yes: I'm fine with pass the same function and rcu_head to both call_rcu() and is_after_call_rcu(). Actually, when I say it like that, it seems less clumsy :-) Thanks, NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAltWTgMACgkQOeye3VZi gbnG8Q//YF0igHPOWpE6aZhAOH4FlDOE+tN1Ca9tmmUYm4Dnze3suqB7QWSi9R8j Y3MHUXHQu1eWtMDpU5oIUX3LYRu3TNkFoUf3BwssXxCUcosMYut6/E/RnJepdCl0 raLvjBc1XoHC7XUmLXnBSDXJSJOPIGVSZvkQx8PDCMwjRhYQC52rrl2ZzAcUjyDA inmYj3RcleZ35sRXTdc6HffYuAeSlH/d7qtimtCtkwZRC+EMcrUCAv4lsUEH9PVG zy4lhb1lkEUbktQXMVkOE5BSeemC9nVltkNbPw4kVdRv3FbRjqhZZR6UMTOJPaRL okkHBrNe6g+/GXsLK4HljAHRyBMnHZ6li+Yql/waJfLP3JlA6Nm2TvTyLdPVu2rS 2xIqmGP6b+HO2qMJlvCSljPdN8SgcYXhJDWu945Layd5QHR783JXNqk37iwLXxy9 0pgzGYpjGdbPaEtNu8YGC05FHoHEDgV9jho7gS1CARM9LxVGSPNrMUm5VsId2eAO NImoMnftvLKtX05DE59G2CJiYnkhEAO4y+CQXzgR59qJ44YHymdCbVEUv/7GF/Xa PRkZGydsjMlilmvnaKiPXRV12yZ9Nr2U0B1kCFJKZkUWIcVh9fvEXABOgzGMfTyD yIde3uHgOe/iEWTaBhdXYoxa+6oZ+rmNxVCdPlo1OwdaoeWz974= =qUTC -----END PGP SIGNATURE----- --=-=-=--