From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: Re: [PATCH 2/5] rhashtable: don't hold lock on first table throughout insertion. Date: Mon, 23 Jul 2018 09:13:43 +1000 Message-ID: <87h8kqrhi0.fsf@notabene.neil.brown.name> 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> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Cc: Herbert Xu , Thomas Graf , netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: paulmck@linux.vnet.ibm.com Return-path: Received: from mx2.suse.de ([195.135.220.15]:52562 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730673AbeGWAMQ (ORCPT ); Sun, 22 Jul 2018 20:12:16 -0400 In-Reply-To: <20180722215446.GH12945@linux.vnet.ibm.com> Sender: netdev-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain 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 structure. > 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? Yes, if you could provide an is_after_call_rcu() API, that would perfectly suit my use-case. Thanks, NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAltVD6cACgkQOeye3VZi gbkh7Q//fsTYBjgz2oplH1RRGFA//cfC7hQhEyQPRdNKAou+es+pLmgE2v4aikms sMHT0AObn6iLv12ZV/Geg0fb1NMRiaFThlC1Lb8sfaA6Hczsgl0YtJEHBvEWIX43 687mapwo51GhdSRQGPkva611qaebO8NOaDWYuhYGONuxCJUl6CLWHqjM4XR2Bug6 RVVd4m7o5RYSwSMVBZb868uHwqRf7R/XnrfNpg4SZAZa0eOeiWK78VJRkdteHYvl 9vsipbhTM6RBi+Zy8qi6AryH/m9RuN3T1D62GKN6cxY6RNJEjzeOqbVGdS2wkjMQ CIsUtYSbjUmd46f1mGJ2AJR/OVU7BJRWLNVutveWH6C++CfscTP3zNuSDtGTzK6u rg19q73dRkfItyvd6E4H2rBInNf3PnzHbhOVEqQIq9zD4ayWl5KQbJyKc09Zjhfa dewwDcKsA+uyIUUFVaA8llpDXVNXboxGT0pXKvmmVIpUEcGGLUA5qc7tIJ95b4ZY efRSL64MdcPlWpPvVv8BKaClpJskfK7S1qpCfj0So6uzh2DmrGUDyLJLspqvfIN/ WRPezvw3RXByV0Xf9oqzboixSfVrDv5MlmJXuP8OiEdYowRxfT4VS78VU1nN/QQs fD7keSNyRIgssEnQBNgxgGmsaYr3C6fKrHzkB2aOjwpii3vTzr4= =AiZF -----END PGP SIGNATURE----- --=-=-=--