From patchwork Fri Feb 16 18:04:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 202282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp689351dyb; Fri, 16 Feb 2024 10:07:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQ57LgJfMI2Fi1Yj9gCeiBl96Gad3fdmga0u1HIOV1zJLmnkRCNAI1VKSupTz8JUile5RkfvDXblwOGmvV9rejFlLRjQ== X-Google-Smtp-Source: AGHT+IGG9SUyBCUCqJiROL34kPPt5LQ6D+weIS//5XpIqY0rujJ2We3uThPMyWovKJJRFA5+Uiuh X-Received: by 2002:a05:6e02:cc4:b0:363:b695:5d5a with SMTP id c4-20020a056e020cc400b00363b6955d5amr4921191ilj.18.1708106827724; Fri, 16 Feb 2024 10:07:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708106827; cv=pass; d=google.com; s=arc-20160816; b=b1GcbGTYf3O/Cj64X/dvrniNIQP7wMPXff4DHMAbFuvqKArrYInykzxhhFDNwwR2N4 6uds0JtQ6BefhMVPQgCoyz9y18OTxGbctkfc/lVAdMiu0pjQyujPAiMhEZFDTWraUox4 aXDkzwOMpMfbg6wpXBW2lWXX68iFpN8d7+j5tExA+uKbp33ZgUHnSKKeVEVn6jNG833G makw96ISroU8LQuJ6QlZHcYC0pACXmP64VULwGNstjl+yjIlHl7OeGkCu+3a4AVmVm79 FID9HPsU4ywhHZwbCas76O9iPlW4ty3HlRV3iBhFyEo4dIlKjBDzoeNfbAeLLvoDlSQu osnQ== 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:sender:dkim-signature; bh=RtvoN2Te8lsuMrpULW6AGCbHjbIm4X87ZQHxVBkQdBg=; fh=e0Zcnf0zLSn0Tv9ivwir6OEkJPfljHn69SOQu70nsl8=; b=wt2FFFINwohWO0o4n/+rTGDKS0AGdykflMduurGkUK0pNVkfvx2z1XDSsKQOeij5XV iVwGzheBvmYv0UBA90tQ4p0Qb4d4S1fv0hjTCtzB4MhjsLANvyGfwXd0Fmr9vKXfUSMU FojcMYXBMGAe7F1hKF5qJ29L003o2pGzIE+kRv6pmCW882cV7AznD50RCcU9jmQ0dc1J ZkljrQQt7mOUzxbWe28Wyx+7VCDeP+wHQXfqQBGXM7gigX04XXfX+5iDS3hHc/utud0I pkwo2byyX+Yc+DSFopg6/N0PxHBb1zgwMGpvgWqm6ircVBpOnYN7q34QuwcRLVZR4fOR 2WiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EhM6jn3u; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-69121-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69121-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n29-20020a63721d000000b005dc927ee2fasi217476pgc.710.2024.02.16.10.07.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:07:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69121-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EhM6jn3u; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-69121-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69121-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 74890281E24 for ; Fri, 16 Feb 2024 18:07:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB783135A4B; Fri, 16 Feb 2024 18:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EhM6jn3u" Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 98A341350F6 for ; Fri, 16 Feb 2024 18:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708106781; cv=none; b=Wn0qTxawFULeQrq7xlzj/HogsEgemBgv6ZqyXb/BioAJStfA4uuqs4g/GKmpDWtkRadI7zwXWm+bsbaiiTX9BtH6Jpwd3Bl4fPaV4luW/Y164dbq/SKf+HMTrl5/1FoXpTJzyB3H0Q/A0dZqC5WvX7wG2zl4gEp3hNBO4qOo4Ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708106781; c=relaxed/simple; bh=dwcDbWOPxRgiZhLXY8mPYkaEIPRTLSYlPdZIIJdc+Lw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZVUZBYKKGSBlspMrK8TdqLbhkXNqr1hfOrG4tCxpvzRDOE5qfUS/3ApjYWAQIbHjXs7O5sfz9A7/oGN+TGOR9ICIx/+9DuhPSSAylQd3XN2Y/yY0OzEObFvUaW6HcarxN1/5mzQ1QrBv5XnFggH9tYRRlufJq8mSmO5fGakqM7A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EhM6jn3u; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1d7881b1843so20778315ad.3 for ; Fri, 16 Feb 2024 10:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708106779; x=1708711579; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=RtvoN2Te8lsuMrpULW6AGCbHjbIm4X87ZQHxVBkQdBg=; b=EhM6jn3uGgGZb73vI9RkmtFYIcS+R/vLQe/gdAGCWzbu4a/iP76puwbvIGS2PitS6g Ukh1HuXnRl1O1JdYnKwXA6OA91SvJyK+t1YiykCvf6IwGSOyYbtiBHH/gWQm6CzxTOHL LAgexkt0+SN/hi5+b8fnW4ldJqDhKwbeCcq9zLx9Z1vO2M59S57R5LnUWjNFw/HtkSZi iuPin6jmDuNUoE7Cx4s5HdmBedPngMB1vQH1xenws1dDZbeqxcigOP+SiKL2h/1pJjow blwP4iY6AoWQKofqUdjZU6X4AEjmwFfaVuFltaLas2POIFxmhc0R6bMra47bNW+d6fws tQxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708106779; x=1708711579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RtvoN2Te8lsuMrpULW6AGCbHjbIm4X87ZQHxVBkQdBg=; b=frdW6zAniv5rNA6mnblt5O8tUHPPiJxSu8TyK7s/scYg8rg3r2rqJ6c6adKhtijgyn Vdb4/rm5jeHC1p06VItY0kFAH67orD7yKyTVzQeTb1rRMrIq4RysfJnZ4UtY+yzdmn0s vSahvRAW2/9HP0il2wYBVBN5CKg+AzepZQwkcmSiTEwhFRm03iGYYFHaSmwlgnzUTCnH b7sUadnIQDir+xVOdjJR4qi9g2zdqs3vmpYddNIkq1zICMz/TEFB5meKj1aJMi65zyDn /xrhLiNdKGHedgddVSrbkR7vPCrXjOe6PlMES8mLIRUKtgexQhKVe7hP7fBaNZHkFjh2 ZwAA== X-Forwarded-Encrypted: i=1; AJvYcCUlAvF6w3/+LE56/DLjzeJVWAuc8yb8Ekr/+nzU+f01HEb6XGEMvbAxEwLrew1yIS84Swjcta3yt4HcA4JUGt1RE8T41FGaW8cK+ciE X-Gm-Message-State: AOJu0YzhjvRP6i46olZeU9zLNs0PZgPmfcrdnM3o7f7KLq27rvqSg0zk 6hPQkwdsR+oJjGFD7tbDG1RX275vmS18GEUjVSzOZP7QlpfbUVcp X-Received: by 2002:a17:903:1106:b0:1d9:e18b:d916 with SMTP id n6-20020a170903110600b001d9e18bd916mr7103005plh.28.1708106778800; Fri, 16 Feb 2024 10:06:18 -0800 (PST) Received: from localhost (dhcp-141-239-158-86.hawaiiantel.net. [141.239.158.86]) by smtp.gmail.com with ESMTPSA id mn8-20020a1709030a4800b001d8d0487edbsm145269plb.223.2024.02.16.10.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:06:18 -0800 (PST) Sender: Tejun Heo From: Tejun Heo To: jiangshanlai@gmail.com Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, allen.lkml@gmail.com, kernel-team@meta.com, Tejun Heo Subject: [PATCH 03/17] workqueue: Rename __cancel_work_timer() to __cancel_timer_sync() Date: Fri, 16 Feb 2024 08:04:44 -1000 Message-ID: <20240216180559.208276-4-tj@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240216180559.208276-1-tj@kernel.org> References: <20240216180559.208276-1-tj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791079824620468514 X-GMAIL-MSGID: 1791079824620468514 __cancel_work_timer() is used to implement cancel_work_sync() and cancel_delayed_work_sync(), similarly to how __cancel_work() is used to implement cancel_work() and cancel_delayed_work(). ie. The _timer part of the name is a complete misnomer. The difference from __cancel_work() is the fact that it syncs against work item execution not whether it handles timers or not. Let's rename it to less confusing __cancel_work_sync(). No functional change. Signed-off-by: Tejun Heo --- kernel/workqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 87750e70b638..7e2af79bfa62 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4075,7 +4075,7 @@ static int cwt_wakefn(wait_queue_entry_t *wait, unsigned mode, int sync, void *k return autoremove_wake_function(wait, mode, sync, key); } -static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) +static bool __cancel_work_sync(struct work_struct *work, bool is_dwork) { static DECLARE_WAIT_QUEUE_HEAD(cancel_waitq); unsigned long flags; @@ -4159,7 +4159,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) */ bool cancel_work_sync(struct work_struct *work) { - return __cancel_work_timer(work, false); + return __cancel_work_sync(work, false); } EXPORT_SYMBOL_GPL(cancel_work_sync); @@ -4264,7 +4264,7 @@ EXPORT_SYMBOL(cancel_delayed_work); */ bool cancel_delayed_work_sync(struct delayed_work *dwork) { - return __cancel_work_timer(&dwork->work, true); + return __cancel_work_sync(&dwork->work, true); } EXPORT_SYMBOL(cancel_delayed_work_sync);