All of lore.kernel.org
 help / color / mirror / Atom feed
* avoiding duplicate icache flushing of shared maps on nommu
@ 2009-11-28 15:40 Mike Frysinger
  2009-11-28 18:53 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mike Frysinger @ 2009-11-28 15:40 UTC (permalink / raw)
  To: David Howells, Paul Mundt, Bernd Schmidt, Jie Zhang
  Cc: Linux kernel mailing list, uclinux-dist-devel

when working with FDPIC, there are many shared maps of read only text
regions (the C library, applet packages like busybox, ...) between
applications.  but the current mm/nommu.c:do_mmap_pgoff() function
will issue an icache flush whenever a vma is added to a mm instead of
only doing it when the map is initially created.  am i missing
something obvious here, or would a change like below be OK ?  this
easily cuts the number of icache flushes during boot by 50% if not
more.

(yes, this now does the icache flush while holding the
nommu_region_sem, but i'm interested if the _idea_ is OK)

--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1409,14 +1409,14 @@ unsigned long do_mmap_pgoff(struct file *file,

    current->mm->total_vm += len >> PAGE_SHIFT;

+   if (prot & PROT_EXEC)
+       flush_icache_range(result, result + len);
+
 share:
    add_vma_to_mm(current->mm, vma);

    up_write(&nommu_region_sem);

-   if (prot & PROT_EXEC)
-       flush_icache_range(result, result + len);
-
    kleave(" = %lx", result);
    return result;

-mike

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-03 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-28 15:40 avoiding duplicate icache flushing of shared maps on nommu Mike Frysinger
2009-11-28 18:53 ` Mike Frysinger
2009-11-30  3:18 ` Jie Zhang
2009-12-02 14:15 ` David Howells
2009-12-02 21:40   ` Mike Frysinger
2009-12-02 23:51     ` David Howells
2009-12-02 22:41   ` Mike Frysinger
2009-12-03 16:14     ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.