public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Divyesh Shah <dpshah@google.com>,
	Nauman Rafique <nauman@google.com>,
	Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Subject: Re: [PATCH] blkio: Fix a crash during rq stats update
Date: Wed, 21 Apr 2010 11:11:15 -0400	[thread overview]
Message-ID: <20100421151115.GB3275@redhat.com> (raw)
In-Reply-To: <20100421145514.GT27497@kernel.dk>

On Wed, Apr 21, 2010 at 04:55:14PM +0200, Jens Axboe wrote:
> On Wed, Apr 21 2010, Vivek Goyal wrote:
> > @@ -1001,6 +1002,10 @@ static struct cfq_group *cfq_get_cfqg(struct cfq_data *cfqd, int create)
> >  	return cfqg;
> >  }
> >  
> > +static inline void cfq_get_cfqg_ref(struct cfq_group *cfqg) {
> > +	atomic_inc(&cfqg->ref);
> > +}
> 
> Would be nicer as
> 
> static inline void cfq_ref_get_cfqg(struct cfq_group *cfqg)
> {

Chagne of name, will do.

> 	atomic_inc(&cfqg->ref);
>         return cfqg;
> }

So you want to return cfqg pointer here instead of return type being void?

> 
> ...
> 
> static inline void cfq_ref_get_cfqg(struct cfq_group *cfqg)
> {
>         return NULL;
> }

Will fix it.

Ok, so in case of CFQ_GROUP_IOSCHED, return a poitner to cfqg upon getting
the reference, otherwise NULL. Will fix it.

Thanks
Vivek
> 
> ...
> 
> > @@ -3560,6 +3570,9 @@ new_queue:
> >  
> >  	rq->elevator_private = cic;
> >  	rq->elevator_private2 = cfqq;
> > +	rq->elevator_private3 = cfqq->cfqg;
> > +	/* rq reference on cfqg */
> > +	cfq_get_cfqg_ref(RQ_CFQG(rq));
> >  	return 0;
> 
> rq->elevator_private3 = cfq_ref_get_cfqg(...);
> 
> -- 
> Jens Axboe

  reply	other threads:[~2010-04-21 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 14:45 [PATCH] blkio: Fix a crash during rq stats update Vivek Goyal
2010-04-21 14:55 ` Jens Axboe
2010-04-21 15:11   ` Vivek Goyal [this message]
2010-04-21 15:14     ` Jens Axboe

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=20100421151115.GB3275@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=dpshah@google.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nauman@google.com \
    /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