[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwuA3ex+XXW+TzOee8ax0g1NK9Mm5F3nYtY1m6YtvUFhQ@mail.gmail.com>
Date: Thu, 7 Jun 2012 18:18:28 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Markus Trippelsdorf <markus@...ppelsdorf.de>
Cc: akpm@...ux-foundation.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>, khlebnikov@...nvz.org,
hughd@...gle.com, kamezawa.hiroyu@...fujitsu.com, oleg@...hat.com,
stable@...r.kernel.org
Subject: Re: [patch 12/12] mm: correctly synchronize rss-counters at exit/exec
On Thu, Jun 7, 2012 at 6:05 PM, Markus Trippelsdorf
<markus@...ppelsdorf.de> wrote:
>
> You've somehow merged the wrong patch.
> The correct version can be found here:
> http://marc.info/?l=linux-kernel&m=133848759505805
It looks like Andrew sent me a bad version.
However, that patch you point at isn't good *either*.
It does totally insane things in xacct_add_tsk(). You can't call
"sync_mm_rss(mm)" on somebody elses mm, yet that is exactly what it
does (and you can't pass in another thread pointer either, since the
whole point of the per-thread counters is that they don't have locking
and aren't atomic, so you can't read them from any other context than
"current").
The thing is, the *only* point where it makes sense to sync the rss
pointers is when you detach the mm from the current thread. And
possibly at "fork()" time, *before* you duplicate the "struct
task_struct" and pollute the new one with stale rss counter values
from the old one.
So doing sync_mm_rss() in xacct_add_tsk() is crazy. Doing it
*anywhere* where mm is not clearly "current->mm" is wrong. If there is
a "get_task_mm()" or similar nearby, it's wrong, it's crap, and it
shouldn't be done.
Oleg, please rescue me? Your patch looks much closer to sane, but it's
not quite there..
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists