mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Huang Ying <ying.huang@intel.com>
To: Stefani Seibold <stefani@seibold.net>
Cc: "huang.ying.caritas@gmail.com" <huang.ying.caritas@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC -v2] kfifo writer side lock-less support
Date: Wed, 25 Aug 2010 08:38:47 +0800	[thread overview]
Message-ID: <1282696727.2708.73.camel@yhuang-dev> (raw)
In-Reply-To: <1282677230.10219.22.camel@wall-e.seibold.net>

On Wed, 2010-08-25 at 03:13 +0800, Stefani Seibold wrote:
> > > > The patch adds only 1 field (unsigned int) to struct __kfifo. I think
> > > > that should be acceptable. Because sizeof(struct __kfifo) should be much
> > > > smaller that __kfifo->mask + 1 in most cases.
> > > 
> > > I don't know what you mean with "because sizeof(struct __kfifo) should
> > > be much smaller that __kfifo->mask + 1 in most cases". I am convinced
> > > that you did not really understand the kfifo code. sizeof(struct
> > > __kfifo) is constant and __kfifo->mask + 1 is the fifo size in elements,
> > > which is not constant. Before you answering study the code first!
> > > 
> > > And is not acceptable to bload the struct __kfifo, because it will never
> > > need by the most users.
> > 
> > I mean, for most user, __kfifo->mask + 1 > sizeof(struct __kfifo), so
> > another 4 bytes for each user is relatively small.
> > 
> 
> You have no idea. As i wrote you should study the code before answering!
> 
> sizeof(struct __kfifo) is always 20 bytes on a 32 bit cpu, and
> kfifo->mask +1 depends on the size of the number of fifo elements and it
> is an initialization parameter. 

After my changing, sizeof(struct __kfifo) should be 24 on 32 bit CPU,
that is 4 bytes more. But I think for most users, kfifo->mask + 1 should
be hundreds or thousands. If the average(kfifo->mask + 1) = 256, the
increment percentage for each user is about:

4 / (256 + 20) = 1.45%

So I think the changes to the size of struct __kfifo should be
acceptable.

Best Regards,
Huang Ying



  reply	other threads:[~2010-08-25  0:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  1:42 Huang Ying
2010-08-24  7:55 ` Stefani Seibold
2010-08-24  8:43   ` Huang Ying
2010-08-24  9:04     ` Stefani Seibold
2010-08-24 12:50       ` Huang Ying
2010-08-24 19:13         ` Stefani Seibold
2010-08-25  0:38           ` Huang Ying [this message]
2010-08-25  8:40       ` Huang Ying

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=1282696727.2708.73.camel@yhuang-dev \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=huang.ying.caritas@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefani@seibold.net \
    /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

all inboxes | Powered by JetHome®