lkml.org 
[lkml]   [2009]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [patch 4/9] oom: Add missing rcu protection of __task_cred() in dump_tasks
    Date
    Thomas Gleixner <tglx@linutronix.de> wrote:

    > + /* Protect __task_cred() access */
    > + rcu_read_lock();
    > printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n",
    > p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
    > get_mm_rss(mm), (int)task_cpu(p), p->signal->oom_adj,
    > p->comm);
    > + rcu_read_unlock();

    No. If there's only one access to __task_cred() like this, use
    task_cred_xxx() or one of its wrappers instead:

    - p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
    + p->pid, task_uid(p), p->tgid, mm->total_vm,

    that limits the size of the critical section.

    David


    \
     
     \ /
      Last update: 2009-12-11 14:53    [W:4.053 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site