All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung.kim@lge.com>
To: shaohua.li@intel.com
Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk, vgoyal@redhat.com,
	jmoyer@redhat.com
Subject: Re: [RFC 1/3]block: seperate CFQ io context management code
Date: Wed, 04 Jan 2012 17:19:51 +0900	[thread overview]
Message-ID: <4F040BA7.9070203@lge.com> (raw)
In-Reply-To: <20120104065454.001785808@sli10-conroe.sh.intel.com>

Hi,

Two of nitpicks below ..


2012-01-04 3:53 PM, Shaohua Li Wrote:
> CFQ's io context management creates a per-device io context for each task.
> It's quite generic. Separate it from CFQ, and use it for fiops I/O scheduler.
> 
> Signed-off-by: Shaohua Li<shaohua.li@intel.com>
> ---

[snip]

> +int ioc_builder_init(struct ioc_builder *builder)
> +{
> +	if (!builder->alloc_ioc || !builder->free_ioc)
> +		return -ENOMEM;
> +
> +	builder->ioc_count = alloc_percpu(unsigned long);
> +	if (!builder->ioc_count)
> +		return -ENOMEM;
> +
> +	builder->ioc_gone = NULL;
> +	spin_lock_init(&builder->ioc_gone_lock);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL(ioc_builder_init);
> +
> +void io_context_builder_exit(struct ioc_builder *builder)

It'd be better using 'ioc_builder_exit' as a name for consistency, IMHO.


> +{
> +	DECLARE_COMPLETION_ONSTACK(all_gone);
> +
> +	builder->ioc_gone =&all_gone;
> +	/* ioc_gone's update must be visible before reading ioc_count */
> +	smp_wmb();
> +
> +	/*
> +	 * this also protects us from entering cfq_slab_kill() with
> +	 * pending RCU callbacks
> +	 */
> +	if (elv_ioc_count_read(*builder->ioc_count))
> +		wait_for_completion(&all_gone);
> +
> +	free_percpu(builder->ioc_count);
> +}
> +EXPORT_SYMBOL(io_context_builder_exit);

[snip]

> +static void queue_data_cic_free_rcu(struct rcu_head *head)
> +{
> +	struct dev_io_context *cic;
> +	struct ioc_builder *builder;
> +
> +	cic = container_of(head, struct dev_io_context, rcu_head);
> +	builder = cic->builder;
> +
> +	builder->free_ioc(builder, cic);
> +	elv_ioc_count_dec(*builder->ioc_count);
> +
> +	if (builder->ioc_gone) {
> +		/*
> +		 * CFQ scheduler is exiting, grab exit lock and check

s/CFQ/IO/ ?

Thanks.
Namhyung Kim

  reply	other threads:[~2012-01-04  8:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04  6:53 [RFC 0/3]block: An IOPS based ioscheduler Shaohua Li
2012-01-04  6:53 ` [RFC 1/3]block: seperate CFQ io context management code Shaohua Li
2012-01-04  8:19   ` Namhyung Kim [this message]
2012-01-04  6:53 ` [RFC 2/3]block: FIOPS ioscheduler core Shaohua Li
2012-01-06  6:05   ` Namjae Jeon
2012-01-07  1:06   ` Zhu Yanhai
2012-01-04  6:53 ` [RFC 3/3]block: fiops read/write request scale Shaohua Li
2012-01-04  7:19 ` [RFC 0/3]block: An IOPS based ioscheduler Dave Chinner
2012-01-05  6:50   ` Shaohua Li
2012-01-06  5:12     ` Shaohua Li
2012-01-06  9:10       ` Namhyung Kim
2012-01-06 14:37       ` Jan Kara
2012-01-09  1:26         ` Shaohua Li
2012-01-15 22:32           ` Vivek Goyal
2012-01-08 22:16       ` Dave Chinner
2012-01-09  1:09         ` Shaohua Li
2012-01-15 22:45           ` Vivek Goyal
2012-01-16  4:36             ` Shaohua Li
2012-01-16  7:11               ` Vivek Goyal
2012-01-16  7:55                 ` Shaohua Li
2012-01-16  8:29                   ` Vivek Goyal
2012-01-17  1:06                     ` Shaohua Li
2012-01-17  9:02                       ` Vivek Goyal
2012-01-18  1:20                         ` Shaohua Li
2012-01-18 13:04                           ` Vivek Goyal
2012-01-19  1:21                             ` Shaohua Li
2012-01-15 22:28       ` Vivek Goyal
2012-01-06  9:41 ` Zhu Yanhai
2012-01-15 22:24 ` Vivek Goyal

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=4F040BA7.9070203@lge.com \
    --to=namhyung.kim@lge.com \
    --cc=axboe@kernel.dk \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=vgoyal@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.