linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: dchinner@redhat.com
Cc: "open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>
Subject: re: vmscan: shrinker->nr updates race and go wrong
Date: Tue, 19 Jul 2011 23:08:26 +0300	[thread overview]
Message-ID: <20110719200826.GC6445@shale.localdomain> (raw)

Hi Dave,

There is a sign error in e5b94d7463e0 "vmscan: shrinker->nr updates
race and go wrong"

mm/vmscan.c +274 shrink_slab(41)
	warn: unsigned 'total_scan' is never less than zero.

   268                  total_scan = nr;
   269                  max_pass = do_shrinker_shrink(shrinker, shrink, 0);
   270                  delta = (4 * nr_pages_scanned) / shrinker->seeks;
   271                  delta *= max_pass;
   272                  do_div(delta, lru_pages + 1);
   273                  total_scan += delta;
   274                  if (total_scan < 0) {
                            ^^^^^^^^^^^^^^
total_scan is unsigned so it's never less than zero here.

   275                          printk(KERN_ERR "shrink_slab: %pF negative objects to "
   276                                 "delete nr=%ld\n",
   277                                 shrinker->shrink, total_scan);
   278                          total_scan = max_pass;
   279                  }

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2011-07-19 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 20:08 Dan Carpenter [this message]
2011-07-20  3:53 ` Dave Chinner

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=20110719200826.GC6445@shale.localdomain \
    --to=error27@gmail.com \
    --cc=dchinner@redhat.com \
    --cc=linux-mm@kvack.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