lkml.org 
[lkml]   [2009]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH 15/20] io-controller: map async requests to appropriate cgroup
    From
    Hi Vivek,

    > +#ifdef CONFIG_TRACK_ASYNC_CONTEXT
    > + if (elv_bio_sync(bio)) {
    > + /* sync io. Determine cgroup from submitting task context. */
    > + cgroup = task_cgroup(current, io_subsys_id);
    > + return cgroup;
    > + }
    > +
    > + /* Async io. Determine cgroup from with cgroup id stored in page */
    > + bio_cgroup_id = get_blkio_cgroup_id(bio);
    > +
    > + if (!bio_cgroup_id)
    > + return NULL;
    > +
    > + cgroup = blkio_cgroup_lookup(bio_cgroup_id);
    > +#else
    > + cgroup = task_cgroup(current, io_subsys_id);
    > +#endif
    > + return cgroup;
    > +}

    There is a case where a kernel thread (such as device-mapper drivers)
    submits a sync IO instead of a task which originates the IO. I think
    you should always use get_blkio_cgroup_id() to determine cgroup.

    Thanks,
    Ryo Tsuruta


    \
     
     \ /
      Last update: 2009-05-28 11:31    [W:0.041 / U:0.276 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site