[Devel] Re: [PATCH] IO Controller: Don't store the pid in single queue circumstances
Vivek Goyal
vgoyal at redhat.com
Fri Mar 27 06:52:35 PDT 2009
On Fri, Mar 27, 2009 at 04:30:50PM +0800, Gui Jianfeng wrote:
> Vivek Goyal wrote:
> ...
> > +int elv_init_ioq(struct elevator_queue *eq, struct io_queue *ioq,
> > + void *sched_queue, int ioprio_class, int ioprio,
> > + int is_sync)
> > +{
> > + struct elv_fq_data *efqd = &eq->efqd;
> > + struct io_group *iog = io_lookup_io_group_current(efqd->queue);
> > +
> > + RB_CLEAR_NODE(&ioq->entity.rb_node);
> > + atomic_set(&ioq->ref, 0);
> > + ioq->efqd = efqd;
> > + ioq->entity.budget = efqd->elv_slice[is_sync];
> > + elv_ioq_set_ioprio_class(ioq, ioprio_class);
> > + elv_ioq_set_ioprio(ioq, ioprio);
> > + ioq->pid = current->pid;
>
> Hi Vivek,
>
> Storing a pid in single queue circumstances doesn't make sence.
> So just store the pid when cfq is used.
>
> Signed-off-by: Gui Jianfeng <guijianfeng at cn.fujitsu.com>
> ---
> block/elevator-fq.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/block/elevator-fq.c b/block/elevator-fq.c
> index df53418..c72f7e6 100644
> --- a/block/elevator-fq.c
> +++ b/block/elevator-fq.c
> @@ -1988,7 +1988,10 @@ int elv_init_ioq(struct elevator_queue *eq, struct io_queue *ioq,
> ioq->entity.budget = efqd->elv_slice[is_sync];
> elv_ioq_set_ioprio_class(ioq, ioprio_class);
> elv_ioq_set_ioprio(ioq, ioprio);
> - ioq->pid = current->pid;
> + if (elv_iosched_single_ioq(eq))
> + ioq->pid = 0;
> + else
> + ioq->pid = current->pid;
> ioq->sched_queue = sched_queue;
Thanks Gui. Yes, if there is a single ioq, this pid will reflect the
pid of the process who caused the creation of the io queue and later
requests from all the other processess will go into same queue.
In fact cfq also has the same issue for async queues where async queue
will store the pid when it is created later all other processes of same
prio level will use it.
So if you think displaying "0" is better than displaying the the pid of
the process who created the queue, then I will include this patch. Right
now I don't have very strong opinion about it.
Thanks
Vivek
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list