Lustre-devel archive on lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH v3 13/26] staging: lustre: libcfs: use int type for CPT identification.
Date: Mon, 25 Jun 2018 10:57:33 +1000	[thread overview]
Message-ID: <871scvadj6.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1529875250-11531-14-git-send-email-jsimmons@infradead.org>

On Sun, Jun 24 2018, James Simmons wrote:

> From: Dmitry Eremin <dmitry.eremin@intel.com>
>
> Use int type for CPT identification to match the linux kernel
> CPU identification.

Can someone site evidence for "int" being the dominant choice for CPU
identification in the kernel?
I looked in cpumask.h and found plenty of "unsigned int".
I also found

Commit: 9b130ad5bb82 ("treewide: make "nr_cpu_ids" unsigned")

which makes nr_cpu_ids unsigned.

So I'm dropping this patch for now as the justification is not
convincing.

If there is a real case to be made, please resubmit.

Thanks,
NeilBrown



>
> Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
> WC-bug-id: https://jira.whamcloud.com/browse/LU-8703
> Reviewed-on: https://review.whamcloud.com/23304
> Reviewed-by: James Simmons <uja.ornl@yahoo.com>
> Reviewed-by: Doug Oucharek <dougso@me.com>
> Reviewed-by: Oleg Drokin <green@whamcloud.com>
> Signed-off-by: James Simmons <jsimmons@infradead.org>
> ---
>  drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h |  8 ++++----
>  drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c          | 14 +++++++-------
>  2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
> index 9dbb0b1..2bb2140 100644
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
> @@ -89,18 +89,18 @@ struct cfs_cpu_partition {
>  	/* NUMA distance between CPTs */
>  	unsigned int			*cpt_distance;
>  	/* spread rotor for NUMA allocator */
> -	unsigned int			cpt_spread_rotor;
> +	int				cpt_spread_rotor;
>  };
>  
>  
>  /** descriptor for CPU partitions */
>  struct cfs_cpt_table {
>  	/* spread rotor for NUMA allocator */
> -	unsigned int			ctb_spread_rotor;
> +	int				ctb_spread_rotor;
>  	/* maximum NUMA distance between all nodes in table */
>  	unsigned int			ctb_distance;
>  	/* # of CPU partitions */
> -	unsigned int			ctb_nparts;
> +	int				ctb_nparts;
>  	/* partitions tables */
>  	struct cfs_cpu_partition	*ctb_parts;
>  	/* shadow HW CPU to CPU partition ID */
> @@ -355,7 +355,7 @@ static inline void cfs_cpu_fini(void)
>  /**
>   * create a cfs_cpt_table with \a ncpt number of partitions
>   */
> -struct cfs_cpt_table *cfs_cpt_table_alloc(unsigned int ncpt);
> +struct cfs_cpt_table *cfs_cpt_table_alloc(int ncpt);
>  
>  /*
>   * allocate per-cpu-partition data, returned value is an array of pointers,
> diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c
> index aaab7cb..8f7de59 100644
> --- a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c
> +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c
> @@ -73,7 +73,7 @@
>  module_param(cpu_pattern, charp, 0444);
>  MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern");
>  
> -struct cfs_cpt_table *cfs_cpt_table_alloc(unsigned int ncpt)
> +struct cfs_cpt_table *cfs_cpt_table_alloc(int ncpt)
>  {
>  	struct cfs_cpt_table *cptab;
>  	int i;
> @@ -788,13 +788,13 @@ static int cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt,
>  	return rc;
>  }
>  
> -#define CPT_WEIGHT_MIN  4u
> +#define CPT_WEIGHT_MIN 4
>  
> -static unsigned int cfs_cpt_num_estimate(void)
> +static int cfs_cpt_num_estimate(void)
>  {
> -	unsigned int nnode = num_online_nodes();
> -	unsigned int ncpu = num_online_cpus();
> -	unsigned int ncpt;
> +	int nnode = num_online_nodes();
> +	int ncpu = num_online_cpus();
> +	int ncpt;
>  
>  	if (ncpu <= CPT_WEIGHT_MIN) {
>  		ncpt = 1;
> @@ -824,7 +824,7 @@ static unsigned int cfs_cpt_num_estimate(void)
>  	/* config many CPU partitions on 32-bit system could consume
>  	 * too much memory
>  	 */
> -	ncpt = min(2U, ncpt);
> +	ncpt = min(2, ncpt);
>  #endif
>  	while (ncpu % ncpt)
>  		ncpt--; /* worst case is 1 */
> -- 
> 1.8.3.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20180625/de069a31/attachment.sig>

  reply	other threads:[~2018-06-25  0:57 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-24 21:20 [lustre-devel] [PATCH v3 00/26] staging: lustre: libcfs: SMP rework James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 01/26] staging: lustre: libcfs: remove useless CPU partition code James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 02/26] staging: lustre: libcfs: rename variable i to cpu James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 03/26] staging: lustre: libcfs: properly handle failure cases in SMP code James Simmons
2018-06-25  0:20   ` NeilBrown
2018-06-26  0:33     ` James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 04/26] staging: lustre: libcfs: replace MAX_NUMNODES with nr_node_ids James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 05/26] staging: lustre: libcfs: remove excess space James Simmons
2018-06-25  0:35   ` NeilBrown
2018-06-26  0:55     ` James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 06/26] staging: lustre: libcfs: replace num_possible_cpus() with nr_cpu_ids James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 07/26] staging: lustre: libcfs: NUMA support James Simmons
2018-06-25  0:39   ` NeilBrown
2018-06-25 18:22     ` Doug Oucharek
2018-06-27  2:44       ` NeilBrown
2018-06-27 12:42         ` Patrick Farrell
2018-06-28  1:17           ` NeilBrown
2018-06-29 17:19             ` Doug Oucharek
2018-06-29 17:27               ` Amir Shehata
2018-06-29 17:47                 ` Weber, Olaf
2018-07-04  5:22                   ` NeilBrown
2018-07-04  8:40                     ` Weber, Olaf
2018-07-05  1:57                       ` NeilBrown
2018-07-06  0:20                       ` James Simmons
2018-07-06  0:40                         ` Patrick Farrell
2018-07-06  3:11                         ` NeilBrown
2018-07-06  5:36                           ` Doug Oucharek
2018-07-06  6:13                             ` NeilBrown
2018-07-06 15:57                               ` James Simmons
2018-07-06 16:04                                 ` Patrick Farrell
2018-06-26  0:39     ` James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 08/26] staging: lustre: libcfs: add cpu distance handling James Simmons
2018-06-25  0:48   ` NeilBrown
2018-06-26  1:15     ` James Simmons
2018-06-27  2:50       ` NeilBrown
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 09/26] staging: lustre: libcfs: use distance in cpu and node handling James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 10/26] staging: lustre: libcfs: provide debugfs files for distance handling James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 11/26] staging: lustre: libcfs: invert error handling for cfs_cpt_table_print James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 12/26] staging: lustre: libcfs: fix libcfs_cpu coding style James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 13/26] staging: lustre: libcfs: use int type for CPT identification James Simmons
2018-06-25  0:57   ` NeilBrown [this message]
2018-06-26  0:42     ` James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 14/26] staging: lustre: libcfs: rename i to node for cfs_cpt_set_nodemask James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 15/26] staging: lustre: libcfs: rename i to cpu for cfs_cpt_bind James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 16/26] staging: lustre: libcfs: rename cpumask_var_t variables to *_mask James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 17/26] staging: lustre: libcfs: update debug messages James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 18/26] staging: lustre: libcfs: make tolerant to offline CPUs and empty NUMA nodes James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 19/26] staging: lustre: libcfs: report NUMA node instead of just node James Simmons
2018-06-25  1:09   ` NeilBrown
2018-06-25  1:11     ` NeilBrown
2018-06-25 22:57       ` James Simmons
2018-06-26  0:54     ` James Simmons
2018-06-27  2:49       ` NeilBrown
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 20/26] staging: lustre: libcfs: update debug messages in CPT code James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 21/26] staging: lustre: libcfs: rework CPU pattern parsing code James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 22/26] staging: lustre: libcfs: change CPT estimate algorithm James Simmons
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 23/26] staging: lustre: ptlrpc: use current CPU instead of hardcoded 0 James Simmons
2018-06-25  2:38   ` NeilBrown
2018-06-25 22:51     ` James Simmons
2018-06-26  0:34       ` NeilBrown
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 24/26] staging: lustre: libcfs: restore debugfs table reporting for UMP James Simmons
2018-06-25  1:27   ` NeilBrown
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 25/26] staging: lustre: libcfs: make cfs_cpt_tab a static structure James Simmons
2018-06-25  1:32   ` NeilBrown
2018-06-24 21:20 ` [lustre-devel] [PATCH v3 26/26] staging: lustre: libcfs: restore UMP support James Simmons
2018-06-25  1:33 ` [lustre-devel] [PATCH v3 00/26] staging: lustre: libcfs: SMP rework 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=871scvadj6.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=lustre-devel@lists.lustre.org \
    /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