From patchwork Thu Aug 15 01:46:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liao, Chang" X-Patchwork-Id: 13764361 X-Patchwork-Delegate: mhiramat@kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 D584D10F1; Thu, 15 Aug 2024 01:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723686953; cv=none; b=Fe0Fb9X0L/bgDwNI5pxjUnrm4KFZDC7hvf7MtJNgoBbQo2JBtwXVhr4DZbKvcVuO/tc7QZGafP8nDyW5b/JhHj8dSueMkusNlhp9NXi2KJ+4/UIKhvg65DE/nFGqE1iJsMcI0FGzLTHBk/NXLlaN8/SfR6FoeDHrqfJwd6gw+hA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723686953; c=relaxed/simple; bh=nj2pyoZqJqmHJU2rzvoQJXs0NBPBSP422jfhghGWovU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oWJ95sPUTiwV0Mcx0G0TB3bo3CL5T3p9MdDp4Zo2hyAINmk6/cpy1dO2pz3dANRKC3j70IU+pK1YGntyI5MES/KOjJ0C9XmP/AwLFMishDDK3IC79VIV/sK0t5dS5eX3u3sBe4zlrg7gdgWVGYvDHoIEGskhNbSI8MpkTfjTnLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Wkp6M28RDz1HGJg; Thu, 15 Aug 2024 09:52:43 +0800 (CST) Received: from kwepemd200013.china.huawei.com (unknown [7.221.188.133]) by mail.maildlp.com (Postfix) with ESMTPS id 5906E1A0190; Thu, 15 Aug 2024 09:55:48 +0800 (CST) Received: from huawei.com (10.67.174.28) by kwepemd200013.china.huawei.com (7.221.188.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Thu, 15 Aug 2024 09:55:47 +0800 From: Liao Chang To: , , , , , , , , , , , CC: , , , Subject: [PATCH v3 1/2] uprobes: Remove redundant spinlock in uprobe_deny_signal() Date: Thu, 15 Aug 2024 01:46:28 +0000 Message-ID: <20240815014629.2685155-2-liaochang1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815014629.2685155-1-liaochang1@huawei.com> References: <20240815014629.2685155-1-liaochang1@huawei.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemd200013.china.huawei.com (7.221.188.133) Since clearing a bit in thread_info is an atomic operation, the spinlock is redundant and can be removed, reducing lock contention is good for performance. Acked-by: Oleg Nesterov Signed-off-by: Liao Chang Acked-by: Masami Hiramatsu (Google) --- kernel/events/uprobes.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 73cc47708679..76a51a1f51e2 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1979,9 +1979,7 @@ bool uprobe_deny_signal(void) WARN_ON_ONCE(utask->state != UTASK_SSTEP); if (task_sigpending(t)) { - spin_lock_irq(&t->sighand->siglock); clear_tsk_thread_flag(t, TIF_SIGPENDING); - spin_unlock_irq(&t->sighand->siglock); if (__fatal_signal_pending(t) || arch_uprobe_xol_was_trapped(t)) { utask->state = UTASK_SSTEP_TRAPPED;