From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226YpLZxo151FzvfoG80o5fxQQIkSGkDRoWnnrkgn227V5ZoKQ4uro32OvKmHOFI1PBbU9xQ ARC-Seal: i=1; a=rsa-sha256; t=1517013698; cv=none; d=google.com; s=arc-20160816; b=JRzZAXYVmP5P1KWsPvR9uMITLy7iBGJBG/LjL6pgTvRf7FEqQtUZCISS7w7HteY/TS rTnknegkuHn6E88c6CIFw6gbSimgqIRisnvD2DAqHMuuJbtZDue85KQ0tOHVAQLRRoQf G2scSU0QdLpR+/dve56dROR+mKz8DGt4nFuHNo+ukDC1EyFmBEcgKNCkH56uiloqFJKR LFoadF+dKH491vyAIO65pn9TtNsCKVcyaxW3pOI9DXysqEHZgxaahxQEEtX2VrPHhWqn aPZo4IP/OAakT8+VkQHIAsTl4CAuodoNOSot6xrnSYbCyxk2YQC2fXzmuZSTVKvijzj7 0a9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-id:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=QObRuX3EOPy6+R1sxlx5SbK70hpID7dyrVSEUN5qsvg=; b=Vp7xq/Y3xh+WHGT+OJ69tja1cNKSNL221J81RGBi0owoLJG+APTjW7TuC5fkYhKIp4 nYtb8BEN7laY6F1yv9X8HHHj1JCL2M0JvTKlq1N66AE96NR2hglSNYiEuEFn13kUhSsm llGdf/cw//gtJkrRWQqSL84TuUM2UAiOLtg5K+GjVK1j45Cq++iFy/ibhjw5QbezQb0k XXWCOnVF4PgwVPyvhgbmUD0z2bjbgWVN6YU443bzrwbmUNEFXosunLUpekOMSQRzNPev 8MKj5k7dkc1hhJrweBT0NdKVmvCWizt85NyuHuvf9l7zt7c6bfBMDNgjYfpq0hB6/W19 XHzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of andreas.dilger@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=andreas.dilger@intel.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of andreas.dilger@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=andreas.dilger@intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,419,1511856000"; d="scan'208";a="196590618" From: "Dilger, Andreas" To: NeilBrown CC: "Drokin, Oleg" , James Simmons , Greg Kroah-Hartman , lkml , lustre , "Wu, Fengguang" Subject: Re: [PATCH] staging: lustre: lnet/selftest: fix compile error on UP build Thread-Topic: [PATCH] staging: lustre: lnet/selftest: fix compile error on UP build Thread-Index: AQHTlBNUKfe/gJqUxUWg2cnyKRQltaOHZ6GA Date: Sat, 27 Jan 2018 00:41:35 +0000 Message-ID: <37717983-8436-431F-ABCC-365E3425E35C@intel.com> References: <151564345630.21794.1667069238139184132.stgit@noble> <151564360053.21794.4058863911958997341.stgit@noble> <87tvvd84yk.fsf@notabene.neil.brown.name> In-Reply-To: <87tvvd84yk.fsf@notabene.neil.brown.name> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.252.196.135] Content-Type: text/plain; charset="us-ascii" Content-ID: <4DE3192B5C6AF9479586F5CA742518D7@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590363558606001259?= X-GMAIL-MSGID: =?utf-8?q?1590704155693270187?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Jan 22, 2018, at 23:27, NeilBrown wrote: >=20 > When compiled without CONFIG_SMP, we get a compile error > as ->ctb_parts is not defined. >=20 > There is already a function, cfs_cpt_cpumask(), which will get the > cpumask we need, and which handles the UP case by returning a NULL pointe= r. > So use that and handle NULL. > Also avoid the #ifdef by allocating a cpumask_var and copying > into it, rather than sharing the mask. >=20 > Reported-by: kbuild test robot > Fixes: 6106c0f82481 ("staging: lustre: lnet: convert selftest to use work= queues") > Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger > --- > drivers/staging/lustre/lnet/selftest/module.c | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/stag= ing/lustre/lnet/selftest/module.c > index 31a74b48c995..7359aa56d9b3 100644 > --- a/drivers/staging/lustre/lnet/selftest/module.c > +++ b/drivers/staging/lustre/lnet/selftest/module.c > @@ -110,7 +110,8 @@ lnet_selftest_init(void) > lst_init_step =3D LST_INIT_WI_TEST; > for (i =3D 0; i < nscheds; i++) { > int nthrs =3D cfs_cpt_weight(lnet_cpt_table(), i); > - struct workqueue_attrs attrs; > + struct workqueue_attrs attrs =3D {0}; > + cpumask_var_t *mask =3D cfs_cpt_cpumask(lnet_cpt_table(), i); >=20 > /* reserve at least one CPU for LND */ > nthrs =3D max(nthrs - 1, 1); > @@ -121,14 +122,12 @@ lnet_selftest_init(void) > rc =3D -ENOMEM; > goto error; > } > - attrs.nice =3D 0; > - #ifdef CONFIG_CPUMASK_OFFSTACK > - attrs.cpumask =3D lnet_cpt_table()->ctb_parts[i].cpt_cpumask; > - #else > - cpumask_copy(attrs.cpumask, lnet_cpt_table()->ctb_parts[i].cpt_cpumask= ); > - #endif > - attrs.no_numa =3D false; > - apply_workqueue_attrs(lst_test_wq[i], &attrs); > + > + if (mask && alloc_cpumask_var(&attrs.cpumask, GFP_KERNEL)) { > + cpumask_copy(attrs.cpumask, *mask); > + apply_workqueue_attrs(lst_test_wq[i], &attrs); > + free_cpumask_var(attrs.cpumask); > + } > } >=20 > rc =3D srpc_startup(); > --=20 > 2.14.0.rc0.dirty >=20 Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation