Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2027242pxb; Sun, 18 Apr 2021 16:04:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNCM9pPBVTTsHyz62Yj2D2x6Q/KCHlDCz5jcsf4HBWyFMjRnVC7B6UEBwBb7uLk0H83urE X-Received: by 2002:a17:90a:4d8a:: with SMTP id m10mr20764312pjh.42.1618787042812; Sun, 18 Apr 2021 16:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618787042; cv=none; d=google.com; s=arc-20160816; b=uC3ahiOpaYdICVNzkhqTtNU/LgsyLd/39GAV2d1T+zlCw/BapwXy5LAx6y5AYoeuVX Bjh3L4jIBsEf3rPkgJYVzkFCebAsJNw/2f7RazHwS2SBsfT0aYD8lMDZcQsIRWxta1LT ow9e8UK/4xgh2otAd3vlX7ocOlbYCSHX0BtEdQl0ZytUaMXGeY8E9k0Uvk+yTq5SU5TA cup8v930Bwnp8jpkGtjDGxJ20Vmsza3p6+qTozSJIvk8N914dqXjEPKoMbnujNOz+mVF sxM1AXtStCoXKTkT3T7RYa9udgLI3kbK3nM5cd4WRzYmbTGDeWr76PKibyMG3urBdfPq tAow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2pbgAZAAd737lyZ5qqTUDuQSwoGEzsEQ6O218gt7uwI=; b=vuHqbbQyJZ00ybpsp3ksnXBITsmXDgCfIVOSLmCh4Sa2wnth5o4BqyjHbj3wYckcm6 wldVnBaBLpt3/RtEubmx+UuQRgbnkQvg1xsZq7+rYR/uynqNmFs0LQ1HyrU696nwMg9w K96f9oAQiL/qEwOBH5LFRXLyIKcLWFXvqBd2jFLWqaU/zY8LeJFFvsYw9DDmzwIDDCm+ Y6ajuFAPBxLYz8k6Jo5tizKbQupdsO8fXIYPNeugZl4mSlp7vUpbYz81LYTaNbbQAbKw U9DkLjCe/zZA1bzCLCm5/GmhOHKHXmUv4d5rgplrBHZe0sO3sp/t3eIDDK+h1SgyWY0G T4Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si13802037pgv.146.2021.04.18.16.03.50; Sun, 18 Apr 2021 16:04:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232729AbhDRXDu (ORCPT + 99 others); Sun, 18 Apr 2021 19:03:50 -0400 Received: from mail-pg1-f169.google.com ([209.85.215.169]:35633 "EHLO mail-pg1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232023AbhDRXDt (ORCPT ); Sun, 18 Apr 2021 19:03:49 -0400 Received: by mail-pg1-f169.google.com with SMTP id q10so22945835pgj.2; Sun, 18 Apr 2021 16:03:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2pbgAZAAd737lyZ5qqTUDuQSwoGEzsEQ6O218gt7uwI=; b=YjovkHb+QCx1p5jumGPxRjxe0OqKooCOygebRQ4sJj0LfH9Wzp7HEy1sOP0MOOJZpK oT+VMRzl6NKADB6n4mINpBh6RT2YaMvHqjcpMkCaliiSRrE/1aebzWJ4QGqd4ZpEbImn DB9cbez3nIltUOZmzKzhvtxvUg44iWvwHzSbfEi/2aUxZ/NsTp8pt87UqYcAzj07caXA 3JoHwYNwy3ifVDMgzA2UUH3QWGpMUBDdbXJ5OXT9KJuNI09pwmD7XIhr469X4C+vnxJV bLsPUbOB+uGD2h3WBMz2e7yT/RlGkmR623gA71RZH87tcU75duraOVtypEqel6g3iVGq LTKA== X-Gm-Message-State: AOAM533IeM2/iO1OdSr62cE+9oAAf+q0gKG2Z04QW9ndMSpEkohrEy7k BwrRacYzMpcpsrLsRXg95mIHZJ1TMmE= X-Received: by 2002:a62:3246:0:b029:224:6c6f:b3f2 with SMTP id y67-20020a6232460000b02902246c6fb3f2mr17177062pfy.68.1618787000841; Sun, 18 Apr 2021 16:03:20 -0700 (PDT) Received: from ?IPv6:2601:647:4000:d7:93db:a33:19a8:2126? ([2601:647:4000:d7:93db:a33:19a8:2126]) by smtp.gmail.com with ESMTPSA id t19sm5078216pgv.75.2021.04.18.16.03.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Apr 2021 16:03:20 -0700 (PDT) Subject: Re: [PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier To: Christophe JAILLET , tj@kernel.org, jiangshanlai@gmail.com, saeedm@nvidia.com, leon@kernel.org, davem@davemloft.net, kuba@kernel.org, Tejun Heo Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: From: Bart Van Assche Message-ID: <042f5fff-5faf-f3c5-0819-b8c8d766ede6@acm.org> Date: Sun, 18 Apr 2021 16:03:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/18/21 2:26 PM, Christophe JAILLET wrote: > Improve 'create_workqueue', 'create_freezable_workqueue' and > 'create_singlethread_workqueue' so that they accept a format > specifier and a variable number of arguments. > > This will put these macros more in line with 'alloc_ordered_workqueue' and > the underlying 'alloc_workqueue()' function. > > This will also allow further code simplification. Please Cc Tejun for workqueue changes since he maintains the workqueue code. > diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h > index d15a7730ee18..145e756ff315 100644 > --- a/include/linux/workqueue.h > +++ b/include/linux/workqueue.h > @@ -425,13 +425,13 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, > alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | \ > __WQ_ORDERED_EXPLICIT | (flags), 1, ##args) > > -#define create_workqueue(name) \ > - alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) > -#define create_freezable_workqueue(name) \ > - alloc_workqueue("%s", __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ > - WQ_MEM_RECLAIM, 1, (name)) > -#define create_singlethread_workqueue(name) \ > - alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name) > +#define create_workqueue(fmt, args...) \ > + alloc_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, 1, ##args) > +#define create_freezable_workqueue(fmt, args...) \ > + alloc_workqueue(fmt, __WQ_LEGACY | WQ_FREEZABLE | WQ_UNBOUND | \ > + WQ_MEM_RECLAIM, 1, ##args) > +#define create_singlethread_workqueue(fmt, args...) \ > + alloc_ordered_workqueue(fmt, __WQ_LEGACY | WQ_MEM_RECLAIM, ##args) > > extern void destroy_workqueue(struct workqueue_struct *wq); > >