From patchwork Fri Feb 2 17:04:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 195957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp571428dyc; Fri, 2 Feb 2024 09:13:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZDahwb3gaywdA2wcRFIsvZJLcDcLPgjm7chLoy/6ai4Us1diJfioNQjvVi+T02VCdMgQW X-Received: by 2002:a2e:bc08:0:b0:2d0:7572:458c with SMTP id b8-20020a2ebc08000000b002d07572458cmr2535901ljf.1.1706893993990; Fri, 02 Feb 2024 09:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706893993; cv=pass; d=google.com; s=arc-20160816; b=Usg6BmPMGIAlaxznUgB5gh5F+IBwLaAx3DppDlosnIJ7sVQ1rBi4QtxSjCn2JuPxqb zgTRhu8HtAIWUVmPlKo07gga9yque/M8rUuX0ULKiJ8C7hDwjRiJvJKmjxJp4pkjct3W mgcqk3953hC4iS0+I+XrKAnYI8WoPaRhmNtF4sgFnGbOsYc+1ZVT/N9uK1+ef66AZzd4 gM6+58oGiOJUCKOMwEJelPMTB0QhF12lYlUdqzuEdDNPKQK0sSJ/bPBR3HAjaSURn5Wy tcNRXv+qQ0Ane+izDlQ7ExKUty7kZggLZaHKlJM1xSHyqZyxIP/z+4VaJ7AJYAJ61sbx 1ypw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6xv0ghtBWKci3ltFD1w38GyDNGgkmxE+GwKbqBNa0b4=; fh=2eY1bIddnm+7wtNRA7taGka/0pbTp8hjsLmxB4ZewJE=; b=UU8/Rbg5zTsq5jkgkzuTo9UW/6l9zjIEn932/mTFRUrHVjs0w9zk1MtC3zbTXtKeuP bFPxGjB3Jk0Sru6aFCpuUchvBowwCSG0pma44gbKXcgago83Z5wLA6uU0Y4dIFj0ZG4S VwUk+d8p9O/QdNiUvhFnTg+xqqQogJY+pLMk0Hr4y8W+41GFdyz1a+5abfa3J5AYkDRN JgJP992PhspY7B1ZPbpnJzNYRpW+s54TpVpi580RQbb7XaczV97C8GcVtOagWDg+u123 96WDto0szZEkX6+TKey/EpctqoGSauZ/DSsW10xoTRvX5MV+R/HoGQ8926gTFxv9E0nq xQQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@monom.org header.s=dkim header.b=Fs4qqqnl; arc=pass (i=1 spf=pass spfdomain=monom.org dkim=pass dkdomain=monom.org dmarc=pass fromdomain=monom.org); spf=pass (google.com: domain of linux-kernel+bounces-50218-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50218-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=monom.org X-Forwarded-Encrypted: i=1; AJvYcCVbywrsBswETV5YMmXlMb53AyK1Mt/dm2vLBH/Y3YIZXShH8EdMZuslCcIeRpvr73HEWOLOhI0bjJRGsgzALMEP65GOLQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bd20-20020a056402207400b00560022ad8f4si398342edb.583.2024.02.02.09.13.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:13:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50218-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@monom.org header.s=dkim header.b=Fs4qqqnl; arc=pass (i=1 spf=pass spfdomain=monom.org dkim=pass dkdomain=monom.org dmarc=pass fromdomain=monom.org); spf=pass (google.com: domain of linux-kernel+bounces-50218-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50218-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=monom.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7D8471F240DE for ; Fri, 2 Feb 2024 17:13:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9211E14C5A5; Fri, 2 Feb 2024 17:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=monom.org header.i=@monom.org header.b="Fs4qqqnl" Received: from mail.nearlyone.de (mail.nearlyone.de [49.12.199.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F2DD5FEE6; Fri, 2 Feb 2024 17:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.12.199.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893907; cv=none; b=qpIkfHBkyyeFZeRWpten5AFapGx4W8EN3RIv1VGZ2kP3Rfe8ECizy/x0ALMMdqezMcNRgC38CwLLDzGw0Dq7FVYwKw4+anZsGf8c1ObQWCtj0L9Lu32XwJNEyVBFzkQe0huOqYv/4363fCwFX8bD5DLZPcmZpISDVPC5VgV1jXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893907; c=relaxed/simple; bh=p/cssrwWO4JA+lysWQPVqrAGJ0msE/E/7wO3Tnhk2l4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fwCqmD0ElhEf3RBmG0iWsin2bArCHxQBkv30wy0CPNB+RytFE2Hmp5RbtiuSl18Di3L1jly+iA7KOOufh+fR6S8TH3XU19m9CyWs8PTAwMEehCndAsDPH+LyRgl8sxs4LbiyhMA/xh7IKKXWP3Rd75Y30BYwG+m6JYV0uK+6aiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=monom.org; spf=pass smtp.mailfrom=monom.org; dkim=pass (2048-bit key) header.d=monom.org header.i=@monom.org header.b=Fs4qqqnl; arc=none smtp.client-ip=49.12.199.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=monom.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=monom.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 530A1DAE38; Fri, 2 Feb 2024 18:05:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monom.org; s=dkim; t=1706893504; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=6xv0ghtBWKci3ltFD1w38GyDNGgkmxE+GwKbqBNa0b4=; b=Fs4qqqnlwdzstMLeQMich9y4y19YmkMxpUMCLUV3S4+yi/GsqqSRfuNvsdyvJxi/TA0yGX 63LxpEl8JTRHqLYqvJ5KBD0LfgLUYfBr2Rb1Oe/9OLjAW4msbxdEMS7j0a3d5M3f8GfvUO s8XcLGoJW3V5iexXOyhh91tsg9jUC/6Jc9LHVAHU8vM7jR3c9iUi6gF6uZBkLeZaxZAR54 Wq0ZyEJa5YxhoGlC0dvisjmNLzMtJdmbrZIyDqKoFyaCozbKXx3eLwVvYWnQ2XKLEf+uUw x4zieMty50pirlKTav4T27EQ8PzttNMmBdpp2wXX+ffs/eFwP+o+Irj1Wzm/Eg== From: Daniel Wagner To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, stable-rt@vger.kernel.org, Steven Rostedt , Thomas Gleixner , Tom Zanussi , Clark Williams , Daniel Wagner Subject: [PATCH] Revert "crypto: scompress - serialize RT percpu scratch buffer access with a local lock" Date: Fri, 2 Feb 2024 18:04:57 +0100 Message-ID: <20240202170457.29516-2-wagi@monom.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240202170457.29516-1-wagi@monom.org> References: <20240202170457.29516-1-wagi@monom.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789808076587190846 X-GMAIL-MSGID: 1789808076587190846 This reverts commit 0cb152421350004d4dcf3a4523d88c002d0a7973. The stable backport f8f261f9ade2 ("crypto: scompress - Use per-CPU struct instead multiple variables") replaces this downstream workaround. Signed-off-by: Daniel Wagner --- crypto/scompress.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto/scompress.c b/crypto/scompress.c index c2f0077e0801..968bbcf65c94 100644 --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -35,7 +34,6 @@ static void * __percpu *scomp_src_scratches; static void * __percpu *scomp_dst_scratches; static int scomp_scratch_users; static DEFINE_MUTEX(scomp_lock); -static DEFINE_LOCAL_IRQ_LOCK(scomp_scratches_lock); #ifdef CONFIG_NET static int crypto_scomp_report(struct sk_buff *skb, struct crypto_alg *alg) @@ -148,7 +146,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) void **tfm_ctx = acomp_tfm_ctx(tfm); struct crypto_scomp *scomp = *tfm_ctx; void **ctx = acomp_request_ctx(req); - const int cpu = local_lock_cpu(scomp_scratches_lock); + const int cpu = get_cpu(); u8 *scratch_src = *per_cpu_ptr(scomp_src_scratches, cpu); u8 *scratch_dst = *per_cpu_ptr(scomp_dst_scratches, cpu); int ret; @@ -183,7 +181,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) 1); } out: - local_unlock_cpu(scomp_scratches_lock); + put_cpu(); return ret; }