Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp92118lqm; Mon, 10 Jun 2024 13:50:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIe8kbgcRwUCAPC3kA34aV9fY4jRs3eqK11TDELxL7httSaseNCCfP2p2x2E39CZiYMA40CoEBHLs3UX3YTBdqimnxi6bki7M/xiXq+Q== X-Google-Smtp-Source: AGHT+IFLLChYL3PX5pqMJYPmIvRt4qJSk53cMBrnZblYP9SKVwJ58X8fw4c+ACJ+oeU9ENMSI+vz X-Received: by 2002:a05:6a21:6da3:b0:1b8:622a:cf76 with SMTP id adf61e73a8af0-1b8622ad931mr1349725637.48.1718052647238; Mon, 10 Jun 2024 13:50:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718052647; cv=pass; d=google.com; s=arc-20160816; b=jEwdMFNo7dK8kC7uYR3G2qHNjLGq98O2dpt9UA5Wr83NzZ1a5iJPZ9+yBMGusk0mV6 pMDz1W0v/wBa8SZHfrXQ1lFtFyB+XyxbGDnG6GNrG7VXKccpnEWf9iPw30EmWLhv3XGl EWgHn5/n5h53HiRotB6NBf/g/EYIJj82YyBom1fyQ03ud6iu5ILuXi9i5d4FHHPF8oRv s1tiecU+yLZLa+lEVtwkLHWHsJxHeEc+zqgJAqKyriEBmwJpU+0C6fW9odPiIryJdcZ0 zvFME+tdF5sKrix4K12UPqx81qc7IEZLaxo7WrTXa5nDmIbZ46P/YD1U8QLAhl3Cy+bf cO7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=XxeQrYK1W1CzQMoStEUsvSWuSb8kH7BgYf+vCDWtHuA=; fh=mMUjH0gH4cUbQTD1BDcxXS29hVkWddGkVy/V7t0yPjY=; b=umQrvPOhsY3iPnUfezkcVfjWg+49Pw6Br3EPaJfn7jL1TmgIMkKFpg0JMkMfyk5xRg Dnr16Ym6WqtmjIX4AGMjlnmz/TIl/bktGvYBYSeT+Ge7lrL9taZyFulaGnWAVajW/Wer N9u7CFAs5x92oOcAxuRQiwMofVjjKipT0B7CaQ/XpsyoSvAdheD53w9hkUTz0rzTdid6 l0FbjrZ55inn1jAP54l3H0gKGvlxepfRAmx3CtVqm6raWJnagWLfMX6DlMi7eja0tj+8 tQPbRbp9iIgcdoueBVEMzIFPFlOHHDDHUjUpyNeyeadGkIVQVXRuw06P/JXaC+QAgWbh ac8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eUo1fSH9; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eUo1fSH9; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-208864-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208864-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262c07f9si4577172a12.388.2024.06.10.13.50.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 13:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208864-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eUo1fSH9; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eUo1fSH9; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-208864-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208864-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AECCBB245A8 for ; Mon, 10 Jun 2024 20:38:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C9E14EB52; Mon, 10 Jun 2024 20:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="eUo1fSH9"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="q+/oRSpq"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="eUo1fSH9"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="q+/oRSpq" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B59A3433B9; Mon, 10 Jun 2024 20:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718051892; cv=none; b=JHNwZ9t6Y2W16a2sAdR9b2pUyhylXKEjc52SSOYqjAHgKJ8FN/EwEFZNW2+U3+PnuzZ6fRl9NzACvmb+SQtZyv4S3NMACNOSM6QbTZ5/B37ZxCikleIiJGWnTvHFZdF71PudRaSX7PsBAktYk4vtfxl9CiHieeMlAfTM+BDG7Ao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718051892; c=relaxed/simple; bh=Bc6grhxxoBIzR+kXYT94BIz0HLhVjnDl+vcaEYDuro4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Qzhb14u+T0PWN96y2vPR8xKJnD0/kqrctYfKSroSWQPc7QVbI7bI6Xy0/MCFFkDgzKE2gUMOUyHbodz2WQnV844jZBZC+ySp++JDf56XOdAxrvhO2g2yoy1qm+zwAvJe7NS4FPx5OFJa5nzFQw5oqz4Ow2xB/5oPUPvH+5bXhfk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=eUo1fSH9; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=q+/oRSpq; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=eUo1fSH9; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=q+/oRSpq; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 92E13200C8; Mon, 10 Jun 2024 20:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718051888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=XxeQrYK1W1CzQMoStEUsvSWuSb8kH7BgYf+vCDWtHuA=; b=eUo1fSH9gLM/mt2MZ/Xqn0WQP6BqwcDEZ2Tn+n+7ZSpn9bvqBCa3dKM6AToMOjQGR6/qzr Q3vFDrf3E9W2vnQ/jnA25lf3jg/ZnayYYcEG3BnCC99WKFhSmBd1kIJETKLla8+tl6TBF/ 8Lik5O+rdZsRFhUev+SegfXDDULAXBM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718051888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=XxeQrYK1W1CzQMoStEUsvSWuSb8kH7BgYf+vCDWtHuA=; b=q+/oRSpqBAlvQ2Bj4clV5NObxPCqLT87ozD/Mo+AY4A2eaZ1mOfQEbXkNaHDWGQ5BEK/bn 0lOfYSKCDU1EkfCQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=eUo1fSH9; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="q+/oRSpq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718051888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=XxeQrYK1W1CzQMoStEUsvSWuSb8kH7BgYf+vCDWtHuA=; b=eUo1fSH9gLM/mt2MZ/Xqn0WQP6BqwcDEZ2Tn+n+7ZSpn9bvqBCa3dKM6AToMOjQGR6/qzr Q3vFDrf3E9W2vnQ/jnA25lf3jg/ZnayYYcEG3BnCC99WKFhSmBd1kIJETKLla8+tl6TBF/ 8Lik5O+rdZsRFhUev+SegfXDDULAXBM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718051888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=XxeQrYK1W1CzQMoStEUsvSWuSb8kH7BgYf+vCDWtHuA=; b=q+/oRSpqBAlvQ2Bj4clV5NObxPCqLT87ozD/Mo+AY4A2eaZ1mOfQEbXkNaHDWGQ5BEK/bn 0lOfYSKCDU1EkfCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 78F2013A7F; Mon, 10 Jun 2024 20:38:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id LKoVHTBkZ2ZNKQAAD6G6ig (envelope-from ); Mon, 10 Jun 2024 20:38:08 +0000 Message-ID: <3f58c9a6-614f-4188-9a38-72c26fb42c8e@suse.cz> Date: Mon, 10 Jun 2024 22:38:08 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/14] wireguard: allowedips: replace call_rcu by kfree_rcu for simple kmem_cache_free callback Content-Language: en-US To: "Jason A. Donenfeld" , Julia Lawall Cc: kernel-janitors@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , wireguard@lists.zx2c4.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" , Matthew Wilcox References: <20240609082726.32742-1-Julia.Lawall@inria.fr> <20240609082726.32742-2-Julia.Lawall@inria.fr> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+ 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABzSBWbGFzdGltaWwg QmFia2EgPHZiYWJrYUBzdXNlLmN6PsLBlAQTAQoAPgIbAwULCQgHAwUVCgkICwUWAgMBAAIe AQIXgBYhBKlA1DSZLC6OmRA9UCJPp+fMgqZkBQJkBREIBQkRadznAAoJECJPp+fMgqZkNx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0mSwujpkQ PVAiT6fnzIKmZAUCZAUSmwUJDK5EZgAKCRAiT6fnzIKmZOJGEACOKABgo9wJXsbWhGWYO7mD 8R8mUyJHqbvaz+yTLnvRwfe/VwafFfDMx5GYVYzMY9TWpA8psFTKTUIIQmx2scYsRBUwm5VI EurRWKqENcDRjyo+ol59j0FViYysjQQeobXBDDE31t5SBg++veI6tXfpco/UiKEsDswL1WAr tEAZaruo7254TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Level: X-Spamd-Result: default: False [-4.50 / 50.00]; BAYES_HAM(-3.00)[99.98%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_BLOCKED(0.00)[suse.cz:dkim]; RCPT_COUNT_TWELVE(0.00)[12]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.cz:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 92E13200C8 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Score: -4.50 On 6/9/24 4:32 PM, Jason A. Donenfeld wrote: > Hi Julia & Vlastimil, > > On Sun, Jun 09, 2024 at 10:27:13AM +0200, Julia Lawall wrote: >> Since SLOB was removed, it is not necessary to use call_rcu >> when the callback only performs kmem_cache_free. Use >> kfree_rcu() directly. > > Thanks, I applied this to the wireguard tree, and I'll send this out as > a fix for 6.10. Let me know if this is unfavorable to you and if you'd > like to take this somewhere yourself, in which case I'll give you my > ack. > > Just a question, though, for Vlastimil -- I know that with the SLOB > removal, kfree() is now allowed on kmemcache'd objects. Do you plan to > do a blanket s/kmem_cache_free/kfree/g at some point, and then remove > kmem_cache_free all together? Hmm, not really, but obligatory Cc for willy who'd love to have "one free() to rule them all" IIRC. My current thinking is that kmem_cache_free() can save the kmem_cache lookup, or serve as a double check if debugging is enabled, and doesn't have much downside. If someone wants to not care about the kmem_cache pointer, they can use kfree(). Even convert their subsystem at will. But a mass conversion of everything would be rather lot of churn for not much of a benefit, IMHO.