From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Memory Management <linux-mm@kvack.org>
Cc: linux-kernel@vger.kernel.org
Subject: [RFC/PATCH 3/12] Add MMF_DEAD flag to mm_struct being torn down
Date: Tue, 07 Aug 2007 17:19:47 +1000 [thread overview]
Message-ID: <20070807071954.1C634DDE1C@ozlabs.org> (raw)
In-Reply-To: <1186471185.826251.312410898174.qpush@grosgo>
This adds a flag to mm_struct that is set when the mm is being
torn down. It's needed by my next patch disconnecting sparc64
tlb flushing from the mmu_gather in order to let the later
become a stack based structure. In general, that flag provides
the information that is in tlb->fullmm but more easily accessible
to all page table accessors.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
include/linux/sched.h | 2 ++
kernel/fork.c | 1 +
mm/mmap.c | 3 +++
3 files changed, 6 insertions(+)
Index: linux-work/include/linux/sched.h
===================================================================
--- linux-work.orig/include/linux/sched.h 2007-08-02 11:25:34.000000000 +1000
+++ linux-work/include/linux/sched.h 2007-08-02 11:39:44.000000000 +1000
@@ -366,6 +366,8 @@ extern int get_dumpable(struct mm_struct
#define MMF_DUMP_FILTER_DEFAULT \
((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED))
+#define MMF_DEAD 6 /* mm is being destroyed */
+
struct mm_struct {
struct vm_area_struct * mmap; /* list of VMAs */
struct rb_root mm_rb;
Index: linux-work/mm/mmap.c
===================================================================
--- linux-work.orig/mm/mmap.c 2007-08-02 11:25:35.000000000 +1000
+++ linux-work/mm/mmap.c 2007-08-02 11:39:44.000000000 +1000
@@ -2025,6 +2025,9 @@ void exit_mmap(struct mm_struct *mm)
unsigned long nr_accounted = 0;
unsigned long end;
+ /* Mark the MM as dead */
+ __set_bit(MMF_DEAD, &mm->flags);
+
/* mm's last user has gone, and its about to be pulled down */
arch_exit_mmap(mm);
Index: linux-work/kernel/fork.c
===================================================================
--- linux-work.orig/kernel/fork.c 2007-07-22 10:26:48.000000000 +1000
+++ linux-work/kernel/fork.c 2007-08-02 11:39:44.000000000 +1000
@@ -336,6 +336,7 @@ static struct mm_struct * mm_init(struct
INIT_LIST_HEAD(&mm->mmlist);
mm->flags = (current->mm) ? current->mm->flags
: MMF_DUMP_FILTER_DEFAULT;
+ __clear_bit(MMF_DEAD, &mm->flags);
mm->core_waiters = 0;
mm->nr_ptes = 0;
set_mm_counter(mm, file_rss, 0);
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-08-07 7:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-07 7:19 [RFC/PATCH 0/12] WIP mmu_gather and PTE accessors work Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 1/12] remove frv usage of flush_tlb_pgtables() Benjamin Herrenschmidt
2007-08-07 7:19 ` Benjamin Herrenschmidt [this message]
2007-08-07 7:19 ` [RFC/PATCH 2/12] remove flush_tlb_pgtables Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 4/12] disconnect sparc64 tlb flush from mmu_gather Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 6/12] Add "address" argument to pte/pmd/pud_free_tlb() Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 5/12] Add mm argument to pte/pmd/pud/pgd_free Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 7/12] ia64 tracks freed page tables addresses Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 8/12] remove ptep_get_and_clear_full Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 9/12] mmu_gather on stack, part 1 Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 10/12] remove call to flush_tlb_page() from handle_pte_fault() Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 11/12] Use mmu_gather for fork() instead of flush_tlb_mm() Benjamin Herrenschmidt
2007-08-07 7:19 ` [RFC/PATCH 12/12] Use mmu_gather for fs/proc/task_mmu.c Benjamin Herrenschmidt
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=20070807071954.1C634DDE1C@ozlabs.org \
--to=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--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