linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dipankar Sarma <dipankar@in.ibm.com>
To: Ed Tomlinson <tomlins@cam.org>
Cc: maneesh@in.ibm.com, linux-kernel@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	Andrew Morton <akpm@zip.com.au>
Subject: Re: [long]2.5.44-mm3 UP went into unexpected trashing
Date: Thu, 24 Oct 2002 21:01:05 +0530	[thread overview]
Message-ID: <20021024210105.A20822@in.ibm.com> (raw)
In-Reply-To: <20021024180809.D11418@in.ibm.com>; from dipankar@in.ibm.com on Thu, Oct 24, 2002 at 06:08:09PM +0530

On Thu, Oct 24, 2002 at 06:08:09PM +0530, Dipankar Sarma wrote:
> On Thu, Oct 24, 2002 at 12:01:31PM +0000, Ed Tomlinson wrote:
> > Would this affect UP systems?  Had the dentry leak on a UP box with 512m 
> > memory.  About 400m ended up in unfreeable dentries...
> 
> It does affect UP systems.
> 
> A quick look at /proc/rcu in a leaky system indicated that somehow
> despite having a batch of RCUs, they are not getting started.
> 
>  /* Fake initialization required by compiler */
> @@ -106,10 +106,11 @@ static void rcu_start_batch(long newbatc
>  		rcu_ctrlblk.maxbatch = newbatch;
>  	}
>  	if (rcu_batch_before(rcu_ctrlblk.maxbatch, rcu_ctrlblk.curbatch) ||
> -	    (rcu_ctrlblk.rcu_cpu_mask != 0)) {
> +	    (find_first_bit(rcu_ctrlblk.rcu_cpu_mask, NR_CPUS) != NR_CPUS)) {
>  		return;
>  	}
> -	rcu_ctrlblk.rcu_cpu_mask = cpu_online_map;
> +	memcpy(rcu_ctrlblk.rcu_cpu_mask, cpu_online_map,
> +	       sizeof(rcu_ctrlblk.rcu_cpu_mask));
>  }
> 
> Either find_first_bit() is not returning NR_CPUS when the bitmask has no
> bit set or memcpy is not working on the UP version of cpu_online_map. Will
> dig a little bit more.

OK, I think I know why this one didn't work.

If the bit_mask is 0, find_first_bit() returns 32 or BITS_PER_LONG.
That works fine as long as NR_CPUS is 32, but when it isn't things
are broken.

    (find_first_bit(rcu_ctrlblk.rcu_cpu_mask, NR_CPUS) != BITS_PER_LONG)) {
		return;

should probably work here.

I guess we need to audit all bitmask tests and fix them to check for
the right value. 

Thanks
-- 
Dipankar Sarma  <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.

  reply	other threads:[~2002-10-24 15:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-24  7:47 [long]2.5.44-mm3 UP went into unexpected trashing Helge Hafting
2002-10-24  7:58 ` Andrew Morton
2002-10-24  8:17   ` Andrew Morton
2002-10-24  9:35     ` Dipankar Sarma
2002-10-24 11:45     ` Maneesh Soni
2002-10-24 11:47       ` Ed Tomlinson
2002-10-24 12:38         ` Dipankar Sarma
2002-10-24 15:31           ` Dipankar Sarma [this message]
2002-10-24 15:46             ` Dipankar Sarma
2002-10-24 23:35               ` Rusty Russell
2002-10-25 12:27                 ` Dipankar Sarma
     [not found]                   ` <3DB98823.67FDBEF3@digeo.com>
     [not found]                     ` <20021025235222.A25786@in.ibm.com>
2002-10-26 15:54                       ` Dipankar Sarma
2002-10-29 12:53                         ` Ed Tomlinson
2002-10-24 12:46         ` Maneesh Soni

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=20021024210105.A20822@in.ibm.com \
    --to=dipankar@in.ibm.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=rusty@rustcorp.com.au \
    --cc=tomlins@cam.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;
as well as URLs for NNTP newsgroup(s).