Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp313623lqo; Thu, 16 May 2024 07:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVq+damMowbtnY719NJCHjFz5MpPUK0gBs+gNW4HOrpsxcXb5hufeH/0XqUQrh4irujSSmPHIdCL52hDc22kk0NBWrhUenmLD0LJeJmwQ== X-Google-Smtp-Source: AGHT+IHgpVHVWr65dzZdU50e2atqJ3efYlTFkRGsOlxDEmILHyY55evuVtleHW3q0ndQRN+NLJZn X-Received: by 2002:a05:6214:434a:b0:6a0:d32d:79d with SMTP id 6a1803df08f44-6a168378562mr205000256d6.56.1715868599008; Thu, 16 May 2024 07:09:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715868598; cv=pass; d=google.com; s=arc-20160816; b=BI+ccAP1iiQM6OT2hTj3baKMU54OmKkqnZNe/7TW2uB2M8Ur2Dg5L50TEedbVCDj9h 1z26pdA9uZ0OadedDIQ15oNBdNw/DD3MHuahbhwBtOnYxTPrVyWuQCC78WkwMQxPC4FL QKJq3y26ybauZl2g0nkCSOzsm8DWUTLD0UDj7Pck+5q2dNbfIaD3I8wtQ9ulVZOAZO3Q yKQnxf72ViyWYrGVtRBFhAKiengr+UdPb0m8TKYAQJRGrMGYsv4tk+O1rLiP/fPEwMZf YNp0hFD7hqjISDeI9DJ3zb3AeomDioK0eSRssiiI7G/7+oCpJBJU6xrZvL0PZALwgcew Gi6Q== 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=dEIQpcAK8bg91eohP6A6VgPv65xtIGvHWMP80UUZFY8=; fh=2zwCh0TY81QL+m8lKeshJdiobUNV+OjhPy1yNmYchVY=; b=Zj2l37x6l2vTg15VE/6EBV7L5n3Yg4iwllte1ogJfTGK9lGfdt2jFVv0mqhgXNYAkH wZDCOrV8zYRaL0+DgnaWjan5SbMrdlM4VzHOyCxFABsJSagq4oeoB0VRTOAyWrAWLYig VN+hUCNbnUBX/uRlZVwqFIBSLmpqOBDUFxzCmAmmZXsu6M2npN8ZUiDdi4LxudejYg8b ow+jp2RuP1gpBpfCdnona+Xnm6MG/VdvUzBO4VF3EVYvC6zK54y9cYC/pI4Skj+bXYN4 8vt7/nVI+BjbAp15khvLiZyI3KaIU85L7mreiD2CA7jgO70ZLEeuowDAW3vm3udYMcsy 4K0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c2zZBGaC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-181151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2b66e4si169140606d6.359.2024.05.16.07.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 07:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c2zZBGaC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-181151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B7E401C21265 for ; Thu, 16 May 2024 14:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E335C14B94F; Thu, 16 May 2024 14:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c2zZBGaC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 173F714A612 for ; Thu, 16 May 2024 14:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715868585; cv=none; b=qcYKL67s2ePGXmZQ/hCgGtgCwFTkpsxpMcO2PvsLDVq+TcbjhaZ1wOQw/aEE/JpZD1+KI288ayXFW6ASCTEAlClsEriKZtv9NQo5Lw4AM4pK+p8iOtIb8R5BdkeMVqP4DMXJwKNVEnRhm/ZsBSO1CtVITDDZVF1TJ6DAMYYAs4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715868585; c=relaxed/simple; bh=o1gUaCc/Uygg+FXN+9Z8jphghyP9VB3u4/xdAgzOEI0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mc7D9H76nc0TFe9/3IQBNnFiA0l6haOze4MB36azbevztalRGTT1E/uYdskOQM8J3ciqxWovoSgKVwflk0XSSK5442l16TweG7aU4tFqbXZDxUdA15BAgZCRhB/XCEDob00tQxaByvdis0UnsJJruMruSxPXW4Mhuecg4q3HnYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c2zZBGaC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54134C2BD11; Thu, 16 May 2024 14:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715868584; bh=o1gUaCc/Uygg+FXN+9Z8jphghyP9VB3u4/xdAgzOEI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2zZBGaCmgmVOWEs5JXIuKPHKymgsLLqzUavuKBqOBlSqpJGGKlNOZzJmJrWhWhjL FPTmNE4TJdYUVqjzDAFH2RGR6Sta53278wYjUXqlald8D8H94u4sgeDZWztDREn5T8 6Uod2NRYHy4B8sN9DF2hfwMR0NwZDBdsHYO8JlMiigiDaZMu5wCat1L92Y2XfmQfEn dIYZ2qdSqh1k9zDScTfdIXkskbrR3WQnAlNM3K75hB5BG0eOTqO+ZY5jmFJhvGFQVm e2iHl8aJI1TyyZJ4E2AtG6rLM3jVquMQuVqRixx0M+Emz6KZwYJ9DZdojLpZou9X93 BLgpcakU1/BLg== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Sebastian Andrzej Siewior Subject: [PATCH 1/4] task_work: s/task_work_cancel()/task_work_cancel_func()/ Date: Thu, 16 May 2024 16:09:33 +0200 Message-Id: <20240516140936.13694-2-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240516140936.13694-1-frederic@kernel.org> References: <20240516140936.13694-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A proper task_work_cancel() API that actually cancels a callback and not *any* callback pointing to a given function is going to be needed for perf events event freeing. Do the appropriate rename to prepare for that. Signed-off-by: Frederic Weisbecker --- include/linux/task_work.h | 2 +- kernel/irq/manage.c | 2 +- kernel/task_work.c | 10 +++++----- security/keys/keyctl.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/task_work.h b/include/linux/task_work.h index 795ef5a68429..23ab01ae185e 100644 --- a/include/linux/task_work.h +++ b/include/linux/task_work.h @@ -30,7 +30,7 @@ int task_work_add(struct task_struct *task, struct callback_head *twork, struct callback_head *task_work_cancel_match(struct task_struct *task, bool (*match)(struct callback_head *, void *data), void *data); -struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t); +struct callback_head *task_work_cancel_func(struct task_struct *, task_work_func_t); void task_work_run(void); static inline void exit_task_work(struct task_struct *task) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index bf9ae8a8686f..ab767e62b19a 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1333,7 +1333,7 @@ static int irq_thread(void *data) * synchronize_hardirq(). So neither IRQTF_RUNTHREAD nor the * oneshot mask bit can be set. */ - task_work_cancel(current, irq_thread_dtor); + task_work_cancel_func(current, irq_thread_dtor); return 0; } diff --git a/kernel/task_work.c b/kernel/task_work.c index 95a7e1b7f1da..54ac24059daa 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -120,9 +120,9 @@ static bool task_work_func_match(struct callback_head *cb, void *data) } /** - * task_work_cancel - cancel a pending work added by task_work_add() - * @task: the task which should execute the work - * @func: identifies the work to remove + * task_work_cancel_func - cancel a pending work matching a function added by task_work_add() + * @task: the task which should execute the func's work + * @func: identifies the func to match with a work to remove * * Find the last queued pending work with ->func == @func and remove * it from queue. @@ -131,7 +131,7 @@ static bool task_work_func_match(struct callback_head *cb, void *data) * The found work or NULL if not found. */ struct callback_head * -task_work_cancel(struct task_struct *task, task_work_func_t func) +task_work_cancel_func(struct task_struct *task, task_work_func_t func) { return task_work_cancel_match(task, task_work_func_match, func); } @@ -168,7 +168,7 @@ void task_work_run(void) if (!work) break; /* - * Synchronize with task_work_cancel(). It can not remove + * Synchronize with task_work_cancel_match(). It can not remove * the first entry == work, cmpxchg(task_works) must fail. * But it can remove another entry from the ->next list. */ diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 10ba439968f7..3aff32a2bcf3 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1693,7 +1693,7 @@ long keyctl_session_to_parent(void) goto unlock; /* cancel an already pending keyring replacement */ - oldwork = task_work_cancel(parent, key_change_session_keyring); + oldwork = task_work_cancel_func(parent, key_change_session_keyring); /* the replacement session keyring is applied just prior to userspace * restarting */ -- 2.34.1