mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dilger, Andreas" <andreas.dilger@intel.com>
To: NeilBrown <neilb@suse.com>
Cc: "Drokin, Oleg" <oleg.drokin@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	lkml <linux-kernel@vger.kernel.org>,
	lustre <lustre-devel@lists.lustre.org>,
	"Wu, Fengguang" <fengguang.wu@intel.com>
Subject: Re: [PATCH] staging: lustre: lnet/selftest: fix compile error on UP build
Date: Sat, 27 Jan 2018 00:41:35 +0000	[thread overview]
Message-ID: <37717983-8436-431F-ABCC-365E3425E35C@intel.com> (raw)
In-Reply-To: <87tvvd84yk.fsf@notabene.neil.brown.name>

On Jan 22, 2018, at 23:27, NeilBrown <neilb@suse.com> wrote:
> 
> When compiled without CONFIG_SMP, we get a compile error
> as ->ctb_parts is not defined.
> 
> 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 pointer.
> So use that and handle NULL.
> Also avoid the #ifdef by allocating a cpumask_var and copying
> into it, rather than sharing the mask.
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Fixes: 6106c0f82481 ("staging: lustre: lnet: convert selftest to use workqueues")
> Signed-off-by: NeilBrown <neilb@suse.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lnet/selftest/module.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/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 = LST_INIT_WI_TEST;
> 	for (i = 0; i < nscheds; i++) {
> 		int nthrs = cfs_cpt_weight(lnet_cpt_table(), i);
> -		struct workqueue_attrs attrs;
> +		struct workqueue_attrs attrs = {0};
> +		cpumask_var_t *mask = cfs_cpt_cpumask(lnet_cpt_table(), i);
> 
> 		/* reserve at least one CPU for LND */
> 		nthrs = max(nthrs - 1, 1);
> @@ -121,14 +122,12 @@ lnet_selftest_init(void)
> 			rc = -ENOMEM;
> 			goto error;
> 		}
> -		attrs.nice = 0;
> -		#ifdef CONFIG_CPUMASK_OFFSTACK
> -		attrs.cpumask = 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 = 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);
> +		}
> 	}
> 
> 	rc = srpc_startup();
> -- 
> 2.14.0.rc0.dirty
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

  reply	other threads:[~2018-01-27  0:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  4:06 [PATCH 0/2] staging: lustre: finish removal of workitem code NeilBrown
2018-01-11  4:06 ` [PATCH 1/2] staging: lustre: lnet: convert selftest to use workqueues NeilBrown
2018-01-15 14:48   ` Greg Kroah-Hartman
2018-01-23  6:27   ` [PATCH] staging: lustre: lnet/selftest: fix compile error on UP build NeilBrown
2018-01-27  0:41     ` Dilger, Andreas [this message]
2018-01-11  4:06 ` [PATCH 2/2] staging: lustre: libcfs: remove workitem code NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37717983-8436-431F-ABCC-365E3425E35C@intel.com \
    --to=andreas.dilger@intel.com \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=neilb@suse.com \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®