From: Christoph Lameter <cl@linux.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Dave Chinner <dchinner@redhat.com>,
linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [fs] inode_lru_isolate(): Move counter increment into spinlock section
Date: Fri, 20 Dec 2013 12:05:29 -0600 (CST) [thread overview]
Message-ID: <alpine.DEB.2.10.1312201202320.13927@nuc> (raw)
In-Reply-To: <20131220033502.GF31386@dastard>
On Fri, 20 Dec 2013, Dave Chinner wrote:
> If count_vm_events requires irqs to be disabled to behave correctly,
> then putting __count_vm_events under a spin lock is still not irq
> safe. Either way, this isn't in a performance critical path, so I'd
> much prefer the simpler, safer option be used rather than leave a
> landmine for other unsuspecting developers.
Subject: [fs] Use safe counter increment operations
The counter increment in inode_lru_isolate is happening with
preemption on using __count_vm_events making counter
increment races possible.
Use count_vm_events instead.
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/fs/inode.c
===================================================================
--- linux.orig/fs/inode.c 2013-12-20 12:02:14.409583380 -0600
+++ linux/fs/inode.c 2013-12-20 12:02:14.409583380 -0600
@@ -722,9 +722,9 @@ inode_lru_isolate(struct list_head *item
unsigned long reap;
reap = invalidate_mapping_pages(&inode->i_data, 0, -1);
if (current_is_kswapd())
- __count_vm_events(KSWAPD_INODESTEAL, reap);
+ count_vm_events(KSWAPD_INODESTEAL, reap);
else
- __count_vm_events(PGINODESTEAL, reap);
+ count_vm_events(PGINODESTEAL, reap);
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += reap;
}
prev parent reply other threads:[~2013-12-20 18:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 19:24 Christoph Lameter
2013-12-19 4:23 ` Dave Chinner
2013-12-19 15:26 ` Christoph Lameter
2013-12-20 3:35 ` Dave Chinner
2013-12-20 17:52 ` Christoph Lameter
2013-12-20 18:05 ` Christoph Lameter [this message]
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=alpine.DEB.2.10.1312201202320.13927@nuc \
--to=cl@linux.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®