mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vadim Lobanov <vlobanov@speakeasy.net>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] fdtable: Make fdarray and fdsets equal in size.
Date: Tue, 10 Oct 2006 11:36:34 -0700	[thread overview]
Message-ID: <200610101136.34341.vlobanov@speakeasy.net> (raw)
In-Reply-To: <200610101912.56280.dada1@cosmosbay.com>

On Tuesday 10 October 2006 10:12, Eric Dumazet wrote:
> On Friday 06 October 2006 06:51, Vadim Lobanov wrote:
> > -	nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nr + 1));
> > -	if (nfds > NR_OPEN)
> > -		nfds = NR_OPEN;
> > -
> > -  	new_openset = alloc_fdset(nfds);
> > -  	new_execset = alloc_fdset(nfds);
> > -  	if (!new_openset || !new_execset)
> > -  		goto out;
> > -	fdt->open_fds = new_openset;
> > -	fdt->close_on_exec = new_execset;
> > -	fdt->max_fdset = nfds;
> > -
> >  	nfds = NR_OPEN_DEFAULT;
> >  	/*
> >  	 * Expand to the max in easy steps, and keep expanding it until
> > @@ -271,15 +254,21 @@ static struct fdtable *alloc_fdtable(int
> >  				nfds = NR_OPEN;
> >    		}
> >  	} while (nfds <= nr);
>
> If I understand well, we may allocate very small fdset, while previous
> minimum size was L1_CACHE_BYTES bytes. (512 bits for a 64 bytes cache line)
>
> If you check commit 0c9e63fd38a2fb2181668a0cdd622a3c23cfd567,
> (http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=com
>mit;h=0c9e63fd38a2fb2181668a0cdd622a3c23cfd567 ) you'll find this comment of
> mine :
>
> 3) Reduce size of allocated fdset.  Currently two full pages are
>    allocated, that is 32768 bits on x86 for example, and way too much.  The
>    minimum is now L1_CACHE_BYTES.
>
> This minimum is mandatory to be sure two tasks wont share the same cache
> line to store their fdset (and possibly do lot of cache line ping pongs)

Good point. This should be easy to fix -- we can simply bump up the allocation 
'nr' when calling alloc_fdmem() for the fdset. Since we won't cross a page 
size, the rest of the code will still stay the same.

I'll code this up once I track down why other folks are experiencing oopses.

> Eric

-- Vadim Lobanov

      reply	other threads:[~2006-10-10 18:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-06  4:51 Vadim Lobanov
2006-10-06  6:45 ` Dipankar Sarma
2006-10-10 17:12 ` Eric Dumazet
2006-10-10 18:36   ` Vadim Lobanov [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=200610101136.34341.vlobanov@speakeasy.net \
    --to=vlobanov@speakeasy.net \
    --cc=akpm@osdl.org \
    --cc=dada1@cosmosbay.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®