All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: nagar@watson.ibm.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Optimize struct task_delay_info
Date: Mon, 23 Jul 2007 10:44:29 +0530	[thread overview]
Message-ID: <46A43935.6040000@linux.vnet.ibm.com> (raw)
In-Reply-To: <1184138034.3068.51.camel@ymzhang>

Zhang, Yanmin wrote:
> struct task_delay_info is used by per process block I/O delay statistics
> feature which is useful in kernel. This struct is not optimized.
> 
> My patch against kernel 2.6.22 shrinks it a half.
> 
> 1) Delete blkio_start and blkio_end. As the collection happens in
> io_schedule and io_schedule_timeout, we use local variables to
> replace them;

I am not sure if it's a good idea to push items on the stack.
Remember we are moving to 4K stacks.

> 2) Delete lock. The change to the protected data has no nested cases.
> In addition, the result is for performance data collection, so it’s
> unnecessary to add such lock. 

This is a cause of concern, we cannot afford to have incorrect data
collected. Incorrect/unreliable data which is worthless.

> 3) Delete flags. It just has one value. Use the most significant bit of
> blkio_delay (64 bits) to mark it..
> 

Yes, thats true right now, but I am not sure if we should go optimize
that so early. We could end up adding other accounting/extending the
framework, we'll need to add the flags back then.



> -static inline void delayacct_clear_flag(int flag)
> +static inline void delayacct_clear_swapin(void)
>  {
>  	if (current->delays)
> -		current->delays->flags &= ~flag;
> +		current->delays->blkio_delay |= DELAYACCT_PF_SWAPIN;

BTW, you should be clearing the flag here.


Overall, the lock removal is not acceptable. I don't like the bit
hacking for flags and moving counters to the stack either.

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

      parent reply	other threads:[~2007-07-23  5:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11  7:13 [PATCH] Optimize struct task_delay_info Zhang, Yanmin
2007-07-11 11:46 ` Balbir Singh
2007-07-18  4:30   ` Zhang, Yanmin
2007-07-23  1:08     ` Zhang, Yanmin
2007-07-11 12:27 ` Andi Kleen
2007-07-12  8:37   ` Zhang, Yanmin
2007-07-12 18:21     ` Frank Ch. Eigler
2007-07-13  1:52       ` Zhang, Yanmin
2007-07-23  5:14 ` Balbir Singh [this message]

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=46A43935.6040000@linux.vnet.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nagar@watson.ibm.com \
    --cc=yanmin_zhang@linux.intel.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.