From: jeff shia <tshxiayu@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: what is the state of current after an mm_fault occurs?
Date: Wed, 4 Jan 2006 18:40:54 +0800 [thread overview]
Message-ID: <7cd5d4b40601040240n79b2d654t33424e91059988a9@mail.gmail.com> (raw)
Hello,
In my opinion, the state of current should be TASK_RUNNING
after an mm_fault occurs.But I donot know why the function of
handle_mm_fault() set the state of current TASK_RUNNING.
/*
* By the time we get here, we already hold the mm semaphore
*/
int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
unsigned long address, int write_access)
{
pgd_t *pgd;
pmd_t *pmd;
__set_current_state(TASK_RUNNING);
pgd = pgd_offset(mm, address);
inc_page_state(pgfault);
if (is_vm_hugetlb_page(vma))
return VM_FAULT_SIGBUS; /* mapping truncation does this. */
/*
* We need the page table lock to synchronize with kswapd
* and the SMP-safe atomic PTE updates.
*/
spin_lock(&mm->page_table_lock);
pmd = pmd_alloc(mm, pgd, address);
if (pmd) {
pte_t * pte = pte_alloc_map(mm, pmd, address);
if (pte)
return handle_pte_fault(mm, vma, address, write_access, pte, pmd);
}
spin_unlock(&mm->page_table_lock);
return VM_FAULT_OOM;
}
any help will be preferred.
Thank you!!
Jeff
next reply other threads:[~2006-01-04 10:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-04 10:40 jeff shia [this message]
2006-01-05 1:48 ` Andrew Morton
2006-01-05 3:20 ` jeff shia
2006-01-05 3:23 ` Andrew Morton
2006-01-05 20:30 ` Christoph Lameter
2006-01-05 23:18 ` Andrew Morton
2006-01-05 21:17 ` Ram Gupta
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=7cd5d4b40601040240n79b2d654t33424e91059988a9@mail.gmail.com \
--to=tshxiayu@gmail.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®