Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp530428pxj; Fri, 28 May 2021 09:17:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqE6v9eqeEPJDAwIlBRNLksQMg5Jc5Vqd7bSefGHFwg4J83mCHiioi7Bvn8uQMXc4tG8/l X-Received: by 2002:aa7:cf06:: with SMTP id a6mr11000449edy.138.1622218657393; Fri, 28 May 2021 09:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622218657; cv=none; d=google.com; s=arc-20160816; b=PljveDVKsKyV4CSlNFGtt6eJmzoVAFb/PF5rOUMsnlT5J1G20Zjr83kdoytb50ZQSI zH7M+1PhhgyUTnCbFnPthD9/YgZO/bsxxKtMQWQbo0FttXI0rbfNaIyAxWUChgx3uqCr 6NEmVPwc6YF4lMF/UDbFnaNRC+H1eRGi6oO0HFHCOi8z7hvdhO1SMSW2R/ZLPi+7Vh4Q aJLKXMekKmTb93Jww6Sc7cmTlSIDGmcq37JrvWzLw6q3SIawkxn3zeRShiMIuBwfbhoN t3oPnglRk9oDjz48CeFLYnmy/RrHBsIQp49aaP2TEnrJfLb22+PORuEK01G2t1v2R86e 92dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=NqKOQAfvyt+jzwrzPZmX2cFEmEVtOFvl9de23IZJw44=; b=Ss/FJ66U/XXEISTFn2uicYUswKZtDHK6mNX4KfOdjAk4t+6zmxONm38XgsN6w5ep9C CTNzksjHzYHvXXEN4KNHCYVX/jEpfXkCMeL8e5tVCX4gffciFGiyPro4VnqMsm/wIIqV BcPeXN6NgSSKh+4ZIPhJcEwXv7smqUlcLxJuEWyKPO/6o6kX29P1OHV+VmM32rXYJpCw zCJuK0ZfsOwr751Tbi1nmLlrTfLaCg2pbjFJYEx4F6GqHcjSM2B2hmBgPp+7geg8jI9k X2CT2shxOJtTuh1DXJX/eaWvbejpbR52uS6PwFEncm9ApyBPU/cf5c7+3V8C3EF7qTR5 iTyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=f4KFXAEn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=LWxeTJIP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t27si1008429ejd.372.2021.05.28.09.17.13; Fri, 28 May 2021 09:17:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=f4KFXAEn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=LWxeTJIP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234995AbhE1PM6 (ORCPT + 99 others); Fri, 28 May 2021 11:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234653AbhE1PMx (ORCPT ); Fri, 28 May 2021 11:12:53 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC2FC061760; Fri, 28 May 2021 08:11:17 -0700 (PDT) Date: Fri, 28 May 2021 17:11:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1622214674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NqKOQAfvyt+jzwrzPZmX2cFEmEVtOFvl9de23IZJw44=; b=f4KFXAEnQtZqr8c5FBv+H4z7PxXv1eaZNTVMoqZ/vZmOaK4DdUayREtZcGBePe5QC8RRB/ VX/tNpORZIT70kJcHiQJCCXYDIekkuYKhQ1R/f6E1Mry4I17R7pyGNL0iSY+zsKzfTbX08 y52vRjeIvC2oRfNmh+dOSD/nNRLboq9SSfLHhc/iFh3rzaog41sJJtejWcKpGBogNkZLIj Rzxxp32TrhDfEdTtizbUtdJwmM4gY5rCFcyJP4qnVIHEgaUXpC660xJFLYT7IKe3ApE6oU 4P45InAzqm266K05Gvbr3stiEusf5gLGDWFi2X7UPqctaLwBr7of5UWIVM4MiQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1622214674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NqKOQAfvyt+jzwrzPZmX2cFEmEVtOFvl9de23IZJw44=; b=LWxeTJIPdPzpxWiqRWQmP+z+TenWtCY/2/AYuJZelRkd7AAm2XA5czAdJc8m9zBY7Q6LUO es/iMtL3msAltnAg== From: "Ahmed S. Darwish" To: Varad Gautam Cc: linux-kernel@vger.kernel.org, linux-rt-users , netdev@vger.kernel.org, stable@vger.kernel.org, Steffen Klassert , Herbert Xu , "David S. Miller" , Jakub Kicinski , Florian Westphal Subject: Re: [PATCH] xfrm: policy: Read seqcount outside of rcu-read side in xfrm_policy_lookup_bytype Message-ID: References: <20210528120357.29542-1-varad.gautam@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210528120357.29542-1-varad.gautam@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021, Varad Gautam wrote: ... > > Thead 1 (xfrm_hash_resize) Thread 2 (xfrm_policy_lookup_bytype) > > rcu_read_lock(); > mutex_lock(&hash_resize_mutex); > read_seqcount_begin(&xfrm_policy_hash_generation); > mutex_lock(&hash_resize_mutex); // block > xfrm_bydst_resize(); > synchronize_rcu(); // block > > ... > Fixes: a7c44247f70 ("xfrm: policy: make xfrm_policy_lookup_bytype lockless") Minor note: the 'Fixes' commit should be 77cc278f7b20 ("xfrm: policy: Use sequence counters with associated lock") instead. The reason read_seqcount_begin() is emitting a mutex_lock() on PREEMPT_RT is because of the s/seqcount_t/seqcount_mutex_t/ change. Kind regards, -- Ahmed S. Darwish Linutronix GmbH