Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2169540rdb; Tue, 20 Feb 2024 21:48:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcXt70zCniiZZJykrn7o9c1HSKjLRIOIAIWb8DouIyDamWn38j2wtRBRLlw4VSXS0SvHiZpe+MakPV/MD8uT+9IN5bqMMr35lbZEpePg== X-Google-Smtp-Source: AGHT+IF04l6wtvfuFvC4LjGG7h966s6c2vr9JSiKPBwttnJZ3WaZpAlDuAHs7kMn1EhJmm5A53a6 X-Received: by 2002:a05:6402:28c7:b0:564:754c:45bc with SMTP id ef7-20020a05640228c700b00564754c45bcmr7949126edb.18.1708494488010; Tue, 20 Feb 2024 21:48:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708494487; cv=pass; d=google.com; s=arc-20160816; b=PwNMavn71SIO2/nSCPYfFnazZZHsDdvO7NgFYawHxUS/TV1c43dvyVh9L8QXs3LK5O 5hHae6CXPkt59j9lPf9Jh9ob1otDkd+5Paltd+nEut6NXofh5KJMVQ0ffGNiffowKrXW vEFS0hX2vkUOugivbXIY6uDpj1yJmPwvSRumHi3U/WsuSt2HhDFACEGE7jc/riL9ZRDG Mij94l6+Cpu+FrcWQmyFLRHHrz98gizs4aNaCeYYQv4QVjsQTvUdhmWzTBRqIMoGPd7D JdGjPARWvsaY78rzcr3xEbGcEHYZXMo7RoME7Zfy7PgbvzKA9WHp5JleXB2TioF+GcFy 3Y8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=fp0jwvLzKqTFWWavRabMZOMHCIo37a0oGTF58L8clkE=; fh=4jGFDmzHjNZzZLe1POhq7PdTe60AChnmuuSwaan7oyA=; b=z6XdmhWrPABiXdSx7Is72a4W8IK/zbhUOR1qjez7pN7Im6sLWNAGCPK5dqGJenfGNN 7DWYVvl12iOAAfmKKOIJyFCMG9CuZBJ1QNAeSWjoZDA9QuF9Eg332omyDUKc4pg7Lzrq sUWmywlP5CqHQ7eQ4tv+R744R38gJzrGgPNZGTgecxOBcsGp0zsyGAdAQl8v4lyaA4k0 CD6OvZUtILRE0+3JVZexZawhl4WtmvXI5QLwsB+PcfYHTdlcYnVXpGMNc9nZUaQJm9uW jU9/xq/LtvDIYRHrPNYmGpheK1sXKuGuORCQ+//Du1R6ZxaI2bzZyvlnuFl/cbnIJy6X cE0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MClBphUx; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-74113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b25-20020a50ccd9000000b0056452273e35si3075229edj.381.2024.02.20.21.48.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 21:48:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MClBphUx; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-74113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74113-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B198F1F252CD for ; Wed, 21 Feb 2024 05:48:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E0A63A26E; Wed, 21 Feb 2024 05:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MClBphUx" Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 3918839FFC for ; Wed, 21 Feb 2024 05:47:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494424; cv=none; b=oVZTb5isSu9chZ9ZJ6zgydozY2wZ1QfyPXsMwp1d0lmdibhMySVyh9z/gvPZiNTMr/UYdGmnyt9l7IQbT7shaQyGaRuodaPi0iJlfB5ucdQyeW77iVBiAbO1B0HIb/RYCyhNe+duIG6JwJv5jGTD6Nt/OJmvkOI8Xf1L+lgilgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708494424; c=relaxed/simple; bh=gEF1FU5AuR5sMAROEucuVYy4vJ1INvdTgHvHk52s72s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oKWAnd4yI/L7saqIhtKfjSLnkMFHLkeQwsYvrvoeQudQFuABOo/9WneNzC08JO9OqO9pRM+ZNMnsc+6FBKfxgbKB+y6qp0yCrBe2hKoLSmRlZDkAGjMUvJ8mI5nsKoifx6FwelaEp1tHShUdGx5NXQ8f4zlT43Q8bj9vUA+dxlQ= 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=MClBphUx; arc=none smtp.client-ip=209.85.210.44 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-ot1-f44.google.com with SMTP id 46e09a7af769-6ddf26eba3cso4689572a34.0 for ; Tue, 20 Feb 2024 21:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708494422; x=1709099222; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=fp0jwvLzKqTFWWavRabMZOMHCIo37a0oGTF58L8clkE=; b=MClBphUxJcUNV6hMrXfM12q2JP4YIfSqa39xGLIjZ0+zoGWo3O3KyYW3RBPQx+1q4g +Hio5quIy/NfibMQIIMcXt48MbntRXm3sd3wxPF1tJVYAllMYjyoA/HTnzEr9GimsGs1 82d1XewVIACrw/WUCWxTfpnAAws9BmYGyrzGRyXFIpmwRH8nKKpE/kmn1Xiy4GKTme4L weefNFnKhYsR62GhGKYJngesnTT9lXCe0tXfeUS4MoM/AvdV3qG2KN0Fxm85Y6HNxvjl +/awE36BAUW/pfDISrAje5AildFJKm/qit94br1SO3IVx/ufhGb9Ahrt1arwAVV721pQ l/pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708494422; x=1709099222; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fp0jwvLzKqTFWWavRabMZOMHCIo37a0oGTF58L8clkE=; b=onQAUTEpqQO0pYt+CAGq8kklIyNWNdyeLumS0VX/MgX9pkRBTFFXVkyqf0+j58BXLM HYVGB/NtkWiwAgX3t/fIZkusN5mc0BzoIOzTIaxlWCFPMpJhlXcEvJENoF1NKkxkBObf LFJoEv7q5y0+lY0mfXHwWJH20MUDbJgYgTVVoXghegEJ9aSYAfKzyfbY9hAV5INcrtom BZfzs0ZWm0AbwYHW+tJLzd5s9pyyni12ZydJmeSVpj2ZwVhMhAni73HKGoCpqcQu+BfU nqbjtJBK+cKBBvo1eFrbIgs+xZiqImeip8d0Y6HjG8QLHxzPHMRlNAiayM3CVRkDTltR ck/Q== X-Forwarded-Encrypted: i=1; AJvYcCWNESobfcrd09OjbLp74KiR+2fa07FK2uFtsmwW0r5kjzC46rOa3KfBdweyw7rLp4fq0s7uZDdoOZ5BadLF/5BxBngs1MFDRdWFyaB4 X-Gm-Message-State: AOJu0YzNSRxj5ahbLXqanmD+MMBMTQpOjuSXpen+Sm53W3puXxOk/LKJ /JSx/ub1ih+e/ZAsc/DyeBDU1CYlDl6Cqpx+G4QQxMctvnUz0MNX X-Received: by 2002:a05:6358:2486:b0:178:fda7:ef08 with SMTP id m6-20020a056358248600b00178fda7ef08mr18393921rwc.32.1708494422084; Tue, 20 Feb 2024 21:47:02 -0800 (PST) Received: from localhost (dhcp-141-239-158-86.hawaiiantel.net. [141.239.158.86]) by smtp.gmail.com with ESMTPSA id p14-20020a056a0026ce00b006e4887b13ffsm1121856pfw.1.2024.02.20.21.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 21:47:01 -0800 (PST) Sender: Tejun Heo Date: Tue, 20 Feb 2024 19:47:00 -1000 From: Tejun Heo To: Lai Jiangshan Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, allen.lkml@gmail.com, kernel-team@meta.com Subject: Re: [PATCH 12/17] workqueue: Implement disable/enable for (delayed) work items Message-ID: References: <20240216180559.208276-1-tj@kernel.org> <20240216180559.208276-13-tj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello, On Wed, Feb 21, 2024 at 10:54:46AM +0800, Lai Jiangshan wrote: > I think it is better to have the same handling (checking disable count) > in queue_rcu_work(). > > 1) code is consistent with other queuing code > 2) known state: no work item is queued with disable count > 0 > 3) catch wrong usages: some complaining code can be added when adding the check. > > Adding checking and complaining in the code is as important as > adding a comment stating rcu work is not allowed to be disabled/canceled. Sure, will add a WARN_ON_ONCE(). > > I'm not quite sure flush_delayed_work() is safe. Will think more about that. > > I think the code successfully deleting the timer not only owns the pending bit > but also ensures the disable count is zero. Yeah, this should be fine. Thanks. -- tejun