Skip to contentSkip to conversation

+ mmvmacache-optimize-overflow-system-wide-flushing.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Apr 15, 2014 Memory management

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + mmvmacache-optimize-overflow-system-wide-flushing.patch added to -mm tree
To: [email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 15 Apr 2014 13:52:21 -0700

The patch titled
Subject: mm,vmacache: optimize overflow system-wide flushing
has been added to the -mm tree. Its filename is
mmvmacache-optimize-overflow-system-wide-flushing.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mmvmacache-optimize-overflow-system-wide-flushing.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mmvmacache-optimize-overflow-system-wide-flushing.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Davidlohr Bueso <[email protected]>
Subject: mm,vmacache: optimize overflow system-wide flushing

For single threaded workloads, we can avoid flushing and iterating through the entire list of tasks, making the whole function a lot faster, requiring only a single atomic read for the mm_users.

---

 mm/vmacache.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
mm/vmacache.c renamed from mm/vmacache.c~mmvmacache-optimize-overflow-system-wide-flushing +10 -0
diff -puN mm/vmacache.c~mmvmacache-optimize-overflow-system-wide-flushing mm/vmacache.c
@@ -17,6 +17,16 @@ void vmacache_flush_all(struct mm_struct
 {
 	struct task_struct *g, *p;
 
+	/*
+	 * Single threaded tasks need not iterate the entire
+	 * list of process. We can avoid the flushing as well
+	 * since the mm's seqnum was increased and don't have
+	 * to worry about other threads' seqnum. Current's
+	 * flush will occur upon the next lookup.
+	 */
+	if (atomic_read(&mm->mm_users) == 1)
+		return;
+
 	rcu_read_lock();
 	for_each_process_thread(g, p) {
 		/*

_

Patches currently in -mm which might be from [email protected] are

mm-fix-config_debug_vm_rb-description.patch mmvmacache-add-debug-data.patch mmvmacache-optimize-overflow-system-wide-flushing.patch ipc-constify-ipc_ops.patch