From: Suparna Bhattacharya <suparna@in.ibm.com>
To: linux-mm@kvack.org
Subject: use_mm/unuse_mm correctness
Date: Mon, 16 Jun 2003 09:29:44 +0530 [thread overview]
Message-ID: <20030616092944.A10463@in.ibm.com> (raw)
Can anyone spot a problem in the following routines ?
These are used by AIO workqueue routines to take on the
caller's address space when executing certain operations,
and then to switch back to the workqueue thread's original
mm context.
We are seeing some strange bugs in -mm lately, and this
code is one of the suspects. Can't yet see what could be
wrong ...
/*
* use_mm
* Makes the calling kernel thread take on the specified
* mm context.
* Called by the retry thread execute retries within the
* iocb issuer's mm context, so that copy_from/to_user
* operations work seamlessly for aio.
* (Note: this routine is intended to be called only
* from a kernel thread context)
*/
static void use_mm(struct mm_struct *mm)
{
struct mm_struct *active_mm = current->active_mm;
atomic_inc(&mm->mm_count);
current->mm = mm;
current->active_mm = mm;
activate_mm(active_mm, mm);
mmdrop(active_mm);
}
/*
* unuse_mm
* Reverses the effect of use_mm, i.e. releases the
* specified mm context which was earlier taken on
* by the calling kernel thread
* (Note: this routine is intended to be called only
* from a kernel thread context)
*/
void unuse_mm(struct mm_struct *mm)
{
current->mm = NULL;
/* active_mm is still 'mm' */
enter_lazy_tlb(mm, current, smp_processor_id());
}
Regards
Suparna
--
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Labs, India
--
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:"aart@kvack.org"> aart@kvack.org </a>
next reply other threads:[~2003-06-16 3:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-16 3:59 Suparna Bhattacharya [this message]
2003-06-16 6:16 ` Hugh Dickins
2003-06-16 6:43 ` Suparna Bhattacharya
2003-06-16 9:30 ` Hugh Dickins
2003-06-17 0:06 Venu Vadapalli
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=20030616092944.A10463@in.ibm.com \
--to=suparna@in.ibm.com \
--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