Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2325552rwr; Fri, 21 Apr 2023 07:28:02 -0700 (PDT) X-Google-Smtp-Source: AKy350YgjRCZrvYqJH7UFF8uak/AqJYc8peMa3CMUDZVRzSU+GxuUG3idEPA4CrC3MyjZdMSen7i X-Received: by 2002:a17:90a:1d3:b0:245:eb4c:3df8 with SMTP id 19-20020a17090a01d300b00245eb4c3df8mr4920761pjd.2.1682087282216; Fri, 21 Apr 2023 07:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682087282; cv=none; d=google.com; s=arc-20160816; b=AxTnKLzQt5kxxiIYb7PV68ayePSSIyYrHD73GUkrZ3Q2rr/mjJ5Mmbl1gcJ0u9P1xc BkAQfm3MNBQrQ2GL8pOe1vp7D64LEGrsGLBaaVLufzjKaNxAZasfFpUqpDhgAj5MQqqA HmY+m2C5mVDeP3E+TLg1m+udNogvzIdDWkF+UE1uRh1+lE5ArXRHwxUNk+mqhTTcHRaB MS1Re43LWacr4AbpGJQZMze1NmdV0doKXle7tyzNnIKAIHdmvosbVmF1GCwJBpJ3ETL8 MpVIHgbvUfl9QrK+YyXRQZ2ze4DZZoTFmTr9+OL4fYE6jXS8EvcupBmvLdk31yDP0ton Z6KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding:sender :in-reply-to:content-disposition:references:message-id:subject:cc:to :from:date:dkim-signature; bh=Zg2WEL4+utH+Ft3KWi6LzOB1N0s9Rdio81CZdb7zfvc=; b=ibjj58NP0WW2jUoJqFEXP95zrqcjfnBOM3EH7OitWLoV7DZjhh4e8GHqI0IBLef6NV yqpx8bihqY2DJsaMtZpryAhX9jcbCLfFnOqwKKCVtRKBOuwMs8FElsZPU2YbBPmuc19i 5ZwtahZHKrBOkHz6asMWs8bCTyp7nVgomxsmor2NDs8/13BzHjB0DKeru5S3sznK5S77 Z0dKV5cj1UQrcvqI0XRBIwh+ozaK2mnV7I0zOXjbYDAc/HON9XoZVvFQyYZmiwj4mAEZ 8kFQS1k9JScHapFvcnxvNYm3bkjxU3e1vTfhhXnZT1ELdoaz47kP+uDsD2qXg5pcjny/ FPqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=HEzBCT1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mj6-20020a17090b368600b0023d3fad2294si4783409pjb.10.2023.04.21.07.27.48; Fri, 21 Apr 2023 07:28:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=HEzBCT1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbjDUOX1 (ORCPT + 99 others); Fri, 21 Apr 2023 10:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231172AbjDUOX0 (ORCPT ); Fri, 21 Apr 2023 10:23:26 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D81D28E; Fri, 21 Apr 2023 07:23:24 -0700 (PDT) Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33LEEs92027015; Fri, 21 Apr 2023 14:23:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : sender : content-transfer-encoding : mime-version; s=pp1; bh=Zg2WEL4+utH+Ft3KWi6LzOB1N0s9Rdio81CZdb7zfvc=; b=HEzBCT1AYkpFbiAN71cV674OO104f4UZ51lPIWefni/fzzJjx1hjTnRKCzsX/tuEDZL6 tCRQihPbPT0Z3oFMcDuBY1YEAYfVWRSQ0RWBka9ieNeJTueoWmNtBb+419/Av/yRManO 5U/W9Bh+zk2SjCsS9E1NzHKUMHIII9QTXqRHcE8xFn3h6lf5tFeB7NBEF1vrFSoRuWf7 PIT40jHR0rMq8ZsRdFcFCQRILxhVfN/CIsKQm6JsTeHbQbwQL+FHuVzYJG+SlHSYgRW8 DFf+2H4etc+pli5C6Ke5aItC+sa5FAvhNnKRRX6PD1zy0Eru+S8MeCThjE2D7lZEA7La mA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q3v2v8cca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Apr 2023 14:23:11 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 33LEFCWc028741; Fri, 21 Apr 2023 14:23:11 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q3v2v8cax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Apr 2023 14:23:11 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33L7Nr1j024721; Fri, 21 Apr 2023 14:23:09 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3pykj6kcvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Apr 2023 14:23:09 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33LEN5ej52363550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Apr 2023 14:23:05 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B51E320043; Fri, 21 Apr 2023 14:23:05 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DFDD20040; Fri, 21 Apr 2023 14:23:05 +0000 (GMT) Received: from t480-pf1aa2c2 (unknown [9.171.20.228]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 21 Apr 2023 14:23:05 +0000 (GMT) Received: from bblock by t480-pf1aa2c2 with local (Exim 4.96) (envelope-from ) id 1pprfF-004nXF-0B; Fri, 21 Apr 2023 16:23:05 +0200 Date: Fri, 21 Apr 2023 14:23:05 +0000 From: Benjamin Block To: Tejun Heo Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, kernel-team@meta.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: Re: [PATCH 12/22] scsi: Use alloc_ordered_workqueue() to create ordered workqueues Message-ID: <20230421142305.GA1063244@t480-pf1aa2c2.fritz.box> References: <20230421025046.4008499-1-tj@kernel.org> <20230421025046.4008499-13-tj@kernel.org> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20230421025046.4008499-13-tj@kernel.org> Sender: Benjamin Block X-TM-AS-GCONF: 00 X-Proofpoint-GUID: f6XvPMMsExI0RngWgfjlt0wckysaFfCe X-Proofpoint-ORIG-GUID: BGiOleJBoiTZav9Ipe_fa_vTPqvUkDkO Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-21_06,2023-04-21_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 clxscore=1011 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304210123 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 20, 2023 at 04:50:36PM -1000, Tejun Heo wrote: > BACKGROUND > ========== > > When multiple work items are queued to a workqueue, their execution order > doesn't match the queueing order. They may get executed in any order and > simultaneously. When fully serialized execution - one by one in the queueing > order - is needed, an ordered workqueue should be used which can be created > with alloc_ordered_workqueue(). > > However, alloc_ordered_workqueue() was a later addition. Before it, an > ordered workqueue could be obtained by creating an UNBOUND workqueue with > @max_active==1. This originally was an implementation side-effect which was > broken by 4c16bd327c74 ("workqueue: restore WQ_UNBOUND/max_active==1 to be > ordered"). Because there were users that depended on the ordered execution, > 5c0338c68706 ("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") > made workqueue allocation path to implicitly promote UNBOUND workqueues w/ > @max_active==1 to ordered workqueues. > > While this has worked okay, overloading the UNBOUND allocation interface > this way creates other issues. It's difficult to tell whether a given > workqueue actually needs to be ordered and users that legitimately want a > min concurrency level wq unexpectedly gets an ordered one instead. With > planned UNBOUND workqueue updates to improve execution locality and more > prevalence of chiplet designs which can benefit from such improvements, this > isn't a state we wanna be in forever. > > This patch series audits all callsites that create an UNBOUND workqueue w/ > @max_active==1 and converts them to alloc_ordered_workqueue() as necessary. > > WHAT TO LOOK FOR > ================ > > The conversions are from > > alloc_workqueue(WQ_UNBOUND | flags, 1, args..) > > to > > alloc_ordered_workqueue(flags, args...) > > which don't cause any functional changes. If you know that fully ordered > execution is not ncessary, please let me know. I'll drop the conversion and > instead add a comment noting the fact to reduce confusion while conversion > is in progress. > > If you aren't fully sure, it's completely fine to let the conversion > through. The behavior will stay exactly the same and we can always > reconsider later. > > As there are follow-up workqueue core changes, I'd really appreciate if the > patch can be routed through the workqueue tree w/ your acks. Thanks. > > Signed-off-by: Tejun Heo > Cc: "James E.J. Bottomley" > Cc: "Martin K. Petersen" > Cc: linux-scsi@vger.kernel.org > --- > drivers/scsi/NCR5380.c | 5 ++--- > drivers/scsi/hosts.c | 12 ++++++------ > drivers/scsi/libiscsi.c | 5 ++--- > 3 files changed, 10 insertions(+), 12 deletions(-) > The conversions look good to me. Reviewed-by: Benjamin Block -- Best Regards, Benjamin Block / Linux on IBM Z Kernel Development IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vors. Aufs.-R.: Gregor Pillen / Gesch?ftsf?hrung: David Faller Sitz der Ges.: B?blingen / Registergericht: AmtsG Stuttgart, HRB 243294