Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5210526imm; Sun, 22 Jul 2018 16:15:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcdG6//DKu2jpFaH6KiAiCM/rOyhMx6Ta2NlFqGfOIlwRD6rigGBXB6RJPPGp6SEjPNAIsR X-Received: by 2002:a17:902:5617:: with SMTP id h23-v6mr10480746pli.324.1532301302722; Sun, 22 Jul 2018 16:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532301302; cv=none; d=google.com; s=arc-20160816; b=fctwvYXsR4f2PM5R00UaR1ivaxLsGP3rkJI5l/LOLXvbKONWh9SIwFFcptD+h85oqe PleKeyjyYhy4029mUqgN7BN8/MI/ioWTseHi1+x4ytNYKDk1H02irSMttDNFfNKfms2t z3WLe2Zy/mN0KpBo40eZbZ50Q0Cs1S3zk3U2iEH1ilMa6368jxaq5KcJ2Khsl+KwNUcp XsM+WiLfFBQhQYPPH/kvRxCs4C2DiZUi0vv3M5VrSL8VkfZdngwnuXFALY4Fat+8PcKE qzlonLF59v0p0y9XPMUrEsw9kPVCCwA4rIiq/PHzG10GxgU7hz/K9TicSmtXhtY4VNlg /G/A== 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=o2rewKxZQAtX0AZHeDA8l9RUgV21aWRp0HIawMItK/Y=; b=YEEQ4tPXJWWAmlq6iRsjj2IYMuPNIEHEKEfqMPKmnBI2fts6zWh+hbT6zhujIeJh04 WEs9u1UVX/lD0MeKM3iLuKnTAX3MUvdOC5GxDaG/bM9U7BTfJHeVegDSGYiK7retrziQ 8g6RPWpQjXxFqckB0Nyct/9iWd1+NgU2DPwCk7zqSE0kC/okTS9bck/Xr5D204G53bVF akPELVUJolc20c/zd81rZfqhCnVX+DhB25sjcIsBcj3E0ZyseArPxup3RuLOB1HBOurc qxi9qiEmMK71lR40kTmPBfEUZbajcb2fcd7LuOkeJwi3s6rsLkAVrfW//jvuFi0UCz+/ sz6A== 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 95-v6si6580391plc.466.2018.07.22.16.14.46; Sun, 22 Jul 2018 16:15:02 -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 S1731046AbeGWAMR (ORCPT + 99 others); Sun, 22 Jul 2018 20:12:17 -0400 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 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A5267ACE8; Sun, 22 Jul 2018 23:13:53 +0000 (UTC) From: NeilBrown To: paulmck@linux.vnet.ibm.com Date: Mon, 23 Jul 2018 09:13:43 +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: <20180722215446.GH12945@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> Message-ID: <87h8kqrhi0.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 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----- --=-=-=--