lkml.org 
[lkml]   [2009]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] [13/16] POISON: The high level memory error handler in the VM
    On Tue, Apr 07, 2009 at 08:51:46PM +0200, Johannes Weiner wrote:
    > > +
    > > + if (av == NULL) /* Not actually mapped anymore */
    > > + goto out;
    > > +
    > > + read_lock(&tasklist_lock);
    > > + for_each_process (tsk) {
    > > + if (!tsk->mm)
    > > + continue;
    > > + list_for_each_entry (vma, &av->head, anon_vma_node) {
    > > + if (vma->vm_mm == tsk->mm)
    > > + add_to_kill(tsk, page, vma, to_kill, tkc);
    > > + }
    > > + }
    > > + read_unlock(&tasklist_lock);
    > > +out:
    > > + page_unlock_anon_vma(av);
    >
    > If !av, this doesn't need an unlock and in fact crashes due to
    > dereferencing NULL.

    Good point. Fixed. Thanks.
    >
    > > +static int poison_page_prepare(struct page *p, unsigned long pfn, int trapno)
    > > +{
    > > + if (PagePoison(p)) {
    > > + printk(KERN_ERR
    > > + "MCE: Error for already poisoned page at %lx\n", pfn);
    > > + return -1;
    > > + }
    > > + SetPagePoison(p);
    >
    > TestSetPagePoison()?

    It doesn't matter in this case because it doesn't need to be atomic.
    The normal reason for TestSet is atomicity requirements. If someone
    feels strongly about it I can add it.

    -Andi

    --
    ak@linux.intel.com -- Speaking for myself only.


    \
     
     \ /
      Last update: 2009-04-07 21:41    [W:0.024 / U:29.920 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site