mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: "Pavel V. Panteleev" <pp_84@mail.ru>
Cc: linux-mm@kvak.org, linux-kernel@vger.kernel.org,
	andi@firstfloor.org, tj@kernel.org
Subject: Re: [patch] percpu in linux-2.6.35-rc3
Date: Wed, 16 Jun 2010 16:56:39 +0200	[thread overview]
Message-ID: <20100616145639.GE17599@basil.fritz.box> (raw)
In-Reply-To: <E1OOr6Q-0005Zi-00.pp_84-mail-ru@f57.mail.ru>

On Wed, Jun 16, 2010 at 03:48:18PM +0400, Pavel V. Panteleev wrote:
> Hello! My name is Pavel V. Panteleev.
> 
> While working with percpu on linux-2.6.35-rc3 I have found trivial bugs in pcpu_build_alloc_info() function:
> - we should memset group_cnt to 0 by size of group_cnt, not size of group_map;
> - we can delete useless variable group_cnt_max.

Thanks for the patch. Tejun maintains percpu code these days,
putting him into cc.

-Andi

Pavel's patch:

--- percpu_old.c	2010-06-12 06:14:04.000000000 +0400
+++ percpu_new.c	2010-06-16 15:05:16.280214868 +0400
@@ -1086,7 +1086,7 @@
 	static int group_map[NR_CPUS] __initdata;
 	static int group_cnt[NR_CPUS] __initdata;
 	const size_t static_size = __per_cpu_end - __per_cpu_start;
-	int group_cnt_max = 0, nr_groups = 1, nr_units = 0;
+	int nr_groups = 1, nr_units = 0;
 	size_t size_sum, min_unit_size, alloc_size;
 	int upa, max_upa, uninitialized_var(best_upa);	/* units_per_alloc */
 	int last_allocs, group, unit;
@@ -1096,7 +1096,7 @@
 
 	/* this function may be called multiple times */
 	memset(group_map, 0, sizeof(group_map));
-	memset(group_cnt, 0, sizeof(group_map));
+	memset(group_cnt, 0, sizeof(group_cnt));
 
 	/*
 	 * Determine min_unit_size, alloc_size and max_upa such that
@@ -1130,7 +1130,6 @@
 		}
 		group_map[cpu] = group;
 		group_cnt[group]++;
-		group_cnt_max = max(group_cnt_max, group_cnt[group]);
 	}
 
 	/*

-- 
ak@linux.intel.com -- Speaking for myself only.

       reply	other threads:[~2010-06-16 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1OOr6Q-0005Zi-00.pp_84-mail-ru@f57.mail.ru>
2010-06-16 14:56 ` Andi Kleen [this message]
2010-06-17  8:14   ` Tejun Heo
2010-06-16 11:44 Пантелеев Павел

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=20100616145639.GE17599@basil.fritz.box \
    --to=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvak.org \
    --cc=pp_84@mail.ru \
    --cc=tj@kernel.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

Powered by JetHome