Gmail Kalendarz Dokumenty Czytnik Sieć więcej »
Ostatnio odwiedzone grupy | Pomoc | Zaloguj się
Strona główna Grup dyskusyjnych
allocpercpu: Make it a true per cpu allocator by allocating from a per cpu array
W grupie jest obecnie zbyt wiele tematów, które mają się wyświetlać jako pierwsze. Jeśli chcesz, aby ten temat ukazywał się jako pierwszy, zrezygnuj z innych tematów.
Podczas przetwarzania żądania wystąpił błąd. Spróbuj ponownie.
oflaguj
  Wiadomości  26  -  50  z  62   - Zwiń wszystko  -  Przetłumacz wszystko na język: Przetłumaczone (wyświetl wszystkie oryginały) < Starsze  Nowsze >
Piszesz do grupy typu Usenet. Wiadomości wysyłane do grupy tego typu będą widoczne dla każdego w internecie.
Twoja odpowiedź nie została jeszcze wysłana.
Opublikowanie postu powiodło się
 
Od:
Do:
Kopia:
Nawiązanie do:
Dodaj kopie do wiadomości | Dodaj nawiązanie do | Edytuj temat
Temat:
Walidacja:
W celu weryfikacji wpisz znaki, które widzisz na obrazku poniżej, lub też liczby, które usłyszysz po kliknięciu ikony dostępności. Wysłuchaj i wprowadź cyfry, które słyszysz
 
Eric Dumazet  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 08:30
Grupy dyskusyjne: linux.kernel
Od: Eric Dumazet <da...@cosmosbay.com>
Data: Thu, 01 Nov 2007 08:30:08 +0100
Lokalna: Czw. 1 Lis 2007 08:30
Temat: Re: [patch 1/7] allocpercpu: Make it a true per cpu allocator by allocating from a per cpu array
Christoph Lameter a écrit :

> +
> +enum unit_type { FREE, END, USED };
> +
> +static u8 cpu_alloc_map[UNITS_PER_CPU] = { 1, };

You mean END here instead of 1 :)

> +/*
> + * Allocate an object of a certain size
> + *
> + * Returns a per cpu pointer that must not be directly used.
> + */
> +static void *cpu_alloc(unsigned long size)
> +{

We might need to give an alignment constraint here. Some per_cpu users would
like to get a 64 bytes zone, siting in one cache line and not two :)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Temat dyskusji zmieniono na „Allocpercpu: Do __percpu_disguise() only if CONFIG_DEBUG_VM is set”" Eric Dumazet
Eric Dumazet  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 08:30
Grupy dyskusyjne: linux.kernel
Od: Eric Dumazet <da...@cosmosbay.com>
Data: Thu, 01 Nov 2007 08:30:09 +0100
Lokalna: Czw. 1 Lis 2007 08:30
Temat: Re: [patch 3/7] Allocpercpu: Do __percpu_disguise() only if CONFIG_DEBUG_VM is set
Christoph Lameter a écrit :

Yes good idea, but a litle typo here :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Temat dyskusji zmieniono na „[RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead”" David Miller
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 09:00
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 09:00:18 +0100
Lokalna: Czw. 1 Lis 2007 09:00
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Eric Dumazet <da...@cosmosbay.com>
Date: Thu, 01 Nov 2007 08:17:58 +0100

> Say we reserve on x86_64 a really huge (2^32 bytes) area, and change
> VM layout so that each cpu maps its own per_cpu area on this area,
> so that the local per_cpu data sits in the same virtual address on
> each cpu.

This is a mechanism used partially on IA64 already.

I think you have to be very careful, and you can only use this per-cpu
fixed virtual address area in extremely limited cases.

The reason is, I think the address matters, consider list heads, for
example.

So you couldn't do:

        list_add(&obj->list, &per_cpu_ptr(list_head));

and use that per-cpu fixed virtual address.

IA64 seems to use it universally for every __get_cpu_var()
access, so maybe it works out somehow :-)))

I guess if list modifications by remote cpus are disallowed, it would
work (list traversal works because using the fixed virtual address as
the list head sentinal is OK), but that is an extremely fragile
assumption to base the entire mechanism upon.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 10:20
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 10:20:17 +0100
Lokalna: Czw. 1 Lis 2007 10:20
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: David Miller <da...@davemloft.net>
Date: Thu, 01 Nov 2007 00:01:18 -0700 (PDT)

And if I bump PER_CPU_ALLOC_SIZE up to 128K it seems to mostly work.

You'll definitely need to make this work dynamically somehow.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 14:00
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 14:00:26 +0100
Lokalna: Czw. 1 Lis 2007 14:00
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, Eric Dumazet wrote:
> I think this question already came in the past and Linus already answered it,
> but I again ask it. What about VM games with modern cpus (64 bits arches)

> Say we reserve on x86_64 a really huge (2^32 bytes) area, and change VM layout
> so that each cpu maps its own per_cpu area on this area, so that the local
> per_cpu data sits in the same virtual address on each cpu. Then we dont need a
> segment prefix nor adding a 'per_cpu offset'. No need to write special asm
> functions to read/write/increment a per_cpu data and gcc could use normal
> rules for optimizations.

> We only would need adding "per_cpu offset" to get data for a given cpu.

That is basically what IA64 is doing but it not usable because you would
have addresses that mean different things on different cpus. List head
for example require back pointers. If you put a listhead into such a per
cpu area then you may corrupt another cpus per cpu area.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Temat dyskusji zmieniono na „allocpercpu: Make it a true per cpu allocator by allocating from a per cpu array”" Christoph Lameter
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 14:00
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 14:00:28 +0100
Lokalna: Czw. 1 Lis 2007 14:00
Temat: Re: [patch 1/7] allocpercpu: Make it a true per cpu allocator by allocating from a per cpu array

On Thu, 1 Nov 2007, Eric Dumazet wrote:
> Christoph Lameter a écrit :
> > +
> > +enum unit_type { FREE, END, USED };
> > +
> > +static u8 cpu_alloc_map[UNITS_PER_CPU] = { 1, };

> You mean END here instead of 1 :)

Sigh. A leftover. This can be removed.

> > +/*
> > + * Allocate an object of a certain size
> > + *
> > + * Returns a per cpu pointer that must not be directly used.
> > + */
> > +static void *cpu_alloc(unsigned long size)
> > +{

> We might need to give an alignment constraint here. Some per_cpu users would
> like to get a 64 bytes zone, siting in one cache line and not two :)

Well not sure about that. Alignment is mostly useful on SMP with cacheline
contention. This is a per cpu area that should not be contended.

    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Temat dyskusji zmieniono na „[RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead”" Christoph Lameter
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 14:10
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 14:10:11 +0100
Lokalna: Czw. 1 Lis 2007 14:10
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> IA64 seems to use it universally for every __get_cpu_var()
> access, so maybe it works out somehow :-)))

IA64 does not do that. It addds the local cpu offset

#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var,
__ia64_per_cpu_var(local_per_cpu_offset)))
#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var,
__ia64_per_cpu_var(local_per_cpu_offset)))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 14:10
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 14:10:23 +0100
Lokalna: Czw. 1 Lis 2007 14:10
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> > This hunk helped the sparc64 looping OOPS I was getting, but cpus hang
> > in some other fashion soon afterwards.

> And if I bump PER_CPU_ALLOC_SIZE up to 128K it seems to mostly work.

Good....

> You'll definitely need to make this work dynamically somehow.

Obviously. Any ideas how?

I can probably calculate the size based on the number of online nodes when
the per cpu areas are setup. But the setup is done before we even parse
command line arguments. That would still mean a fixed size after bootup.

In order to make it truly dynamic we would have to virtually map the area.
vmap? But that reduces performance.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 22:30
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 22:30:14 +0100
Lokalna: Czw. 1 Lis 2007 22:30
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 06:01:14 -0700 (PDT)

> On Thu, 1 Nov 2007, David Miller wrote:

> > IA64 seems to use it universally for every __get_cpu_var()
> > access, so maybe it works out somehow :-)))

> IA64 does not do that. It addds the local cpu offset

> #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var,
> __ia64_per_cpu_var(local_per_cpu_offset)))
> #define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var,
> __ia64_per_cpu_var(local_per_cpu_offset)))

Oh I see, it's the offset itself which is accessed at the fixed
virtual address slot.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 22:30
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 22:30:13 +0100
Lokalna: Czw. 1 Lis 2007 22:30
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 05:57:12 -0700 (PDT)

> That is basically what IA64 is doing but it not usable because you would
> have addresses that mean different things on different cpus. List head
> for example require back pointers. If you put a listhead into such a per
> cpu area then you may corrupt another cpus per cpu area.

Indeed, but as I pointed out in another mail it actually works if you
set some rules:

1) List insert and delete is only allowed on local CPU lists.

2) List traversal is allowed on remote CPU lists.

I bet we could get all of the per-cpu users to abide by this
rule if we wanted to.

The remaining issue with accessing per-cpu areas at multiple virtual
addresses is D-cache aliasing.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 22:30
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 22:30:16 +0100
Lokalna: Czw. 1 Lis 2007 22:30
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 06:03:44 -0700 (PDT)

> In order to make it truly dynamic we would have to virtually map the
> area.  vmap? But that reduces performance.

But it would still be faster than the double-indirection we do now,
right?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 23:20
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 23:20:08 +0100
Lokalna: Czw. 1 Lis 2007 23:20
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> From: Christoph Lameter <clame...@sgi.com>
> Date: Thu, 1 Nov 2007 15:11:41 -0700 (PDT)

> > On Thu, 1 Nov 2007, David Miller wrote:

> > > The remaining issue with accessing per-cpu areas at multiple virtual
> > > addresses is D-cache aliasing.

> > But that is not an issue for physicallly mapped caches.

> Right but I'd like to use this on sparc64 which has L1 D-cache
> aliasing on some chips :-)

Hmmm... re my message I just send. Then we have to return the memory with
the virtual address not with the physical address on sparc. May result in
zones with holes though.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 23:20
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 23:20:11 +0100
Lokalna: Czw. 1 Lis 2007 23:20
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> The remaining issue with accessing per-cpu areas at multiple virtual
> addresses is D-cache aliasing.

But that is not an issue for physicallly mapped caches.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 23:20
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 23:20:10 +0100
Lokalna: Czw. 1 Lis 2007 23:20
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 15:11:41 -0700 (PDT)

> On Thu, 1 Nov 2007, David Miller wrote:

> > The remaining issue with accessing per-cpu areas at multiple virtual
> > addresses is D-cache aliasing.

> But that is not an issue for physicallly mapped caches.

Right but I'd like to use this on sparc64 which has L1 D-cache
aliasing on some chips :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 23:20
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 23:20:14 +0100
Lokalna: Czw. 1 Lis 2007 23:20
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> From: Christoph Lameter <clame...@sgi.com>
> Date: Thu, 1 Nov 2007 06:03:44 -0700 (PDT)

> > In order to make it truly dynamic we would have to virtually map the
> > area.  vmap? But that reduces performance.

> But it would still be faster than the double-indirection we do now,
> right?

I think I have an idea how to do this. Its a bit x86_64 specific but here
it goes.

We define a virtual area of NR_CPUS * 2M areas that are each mapped by a
PMD. That means we have a fixed virtual address for each cpus per cpu
area.

First cpu is at PER_CPU_START
Second cpu is at PER_CPU_START + 2M

So the per cpu area for cpu n is easily calculated using

PER_CPU_START + cpu << 19

without any lookups.

On bootup we allocate the 2M pages.

After boot is complete we allow the reduction of the size of the per cpu
areas . Lets say we only need 128k per cpu. Then the remaining pages will
be returned to the page allocator.

We create some sysfs thingy were one can see the current reserves of per
cpu storage. If one wants to reduce memory then one can write something to
that to return the remainder of the memory.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 23:40
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Thu, 01 Nov 2007 23:40:10 +0100
Lokalna: Czw. 1 Lis 2007 23:40
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 15:15:39 -0700 (PDT)

> After boot is complete we allow the reduction of the size of the per cpu
> areas . Lets say we only need 128k per cpu. Then the remaining pages will
> be returned to the page allocator.

You don't know how much you will need.  I exhausted the limit on
sparc64 very late in the boot process when the last few userland
services were starting up.

And if I subsequently bring up 100,000 IP tunnels, it will exhaust the
per-cpu allocation area.

You have to make it fully dynamic, there is no way around it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 1 Lis 2007, 23:50
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Thu, 01 Nov 2007 23:50:18 +0100
Lokalna: Czw. 1 Lis 2007 23:50
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> From: Christoph Lameter <clame...@sgi.com>
> Date: Thu, 1 Nov 2007 15:15:39 -0700 (PDT)

> > After boot is complete we allow the reduction of the size of the per cpu
> > areas . Lets say we only need 128k per cpu. Then the remaining pages will
> > be returned to the page allocator.

> You don't know how much you will need.  I exhausted the limit on
> sparc64 very late in the boot process when the last few userland
> services were starting up.

Well you would be able to specify how much will remain. If not it will
just keep the 2M reserve around.

> And if I subsequently bring up 100,000 IP tunnels, it will exhaust the
> per-cpu allocation area.

Each tunnel needs 4 bytes per cpu?

> You have to make it fully dynamic, there is no way around it.

Na. Some reasonable upper limit needs to be set. If we set that to say
32Megabytes and do the virtual mapping then we can just populate the first
2M and only allocate the remainder if we need it. Then we need to rely on
Mel's defrag stuff though defrag memory if we need it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 00:00
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Fri, 02 Nov 2007 00:00:16 +0100
Lokalna: Pt 2 Lis 2007 00:00
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 15:48:00 -0700 (PDT)

Each IP compression tunnel instance does an alloc_percpu().

Since you're the one who wants to change the semantics and guarentees
of this interface, perhaps it might help if you did some greps around
the tree to see how alloc_percpu() is actually used.  That's what
I did when I started running into trouble with your patches.

You cannot put limits of the amount of alloc_percpu() memory available
to clients, please let's proceed with that basic understanding in
mind.  We're wasting a ton of time discussing this fundamental issue.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Eric Dumazet  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 00:10
Grupy dyskusyjne: linux.kernel
Od: Eric Dumazet <da...@cosmosbay.com>
Data: Fri, 02 Nov 2007 00:10:16 +0100
Lokalna: Pt 2 Lis 2007 00:10
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
Christoph Lameter a écrit :

well, if we move last_rx to a percpu var, we need  8 bytes of percpu space per
net_device :)

>> You have to make it fully dynamic, there is no way around it.

> Na. Some reasonable upper limit needs to be set. If we set that to say
> 32Megabytes and do the virtual mapping then we can just populate the first
> 2M and only allocate the remainder if we need it. Then we need to rely on
> Mel's defrag stuff though defrag memory if we need it.

If a 2MB page is not available, could we revert using 4KB pages ? (like
vmalloc stuff), paying an extra runtime overhead of course.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 02:00
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Fri, 02 Nov 2007 02:00:14 +0100
Lokalna: Pt 2 Lis 2007 02:00
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Fri, 2 Nov 2007, Eric Dumazet wrote:
> > Na. Some reasonable upper limit needs to be set. If we set that to say
> > 32Megabytes and do the virtual mapping then we can just populate the first
> > 2M and only allocate the remainder if we need it. Then we need to rely on
> > Mel's defrag stuff though defrag memory if we need it.

> If a 2MB page is not available, could we revert using 4KB pages ? (like
> vmalloc stuff), paying an extra runtime overhead of course.

Sure. Its going to be like vmemmap. There will be limited imposed though
by the amount of virtual space available. Basically the dynamic per cpu
area can be at maximum

available_virtual_space / NR_CPUS

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 02:10
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Fri, 02 Nov 2007 02:10:09 +0100
Lokalna: Pt 2 Lis 2007 02:10
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 1 Nov 2007, David Miller wrote:
> You cannot put limits of the amount of alloc_percpu() memory available
> to clients, please let's proceed with that basic understanding in
> mind.  We're wasting a ton of time discussing this fundamental issue.

There is no point in making absolute demands like "no limits". There are
always limits to everything.

A new implementation avoids the need to allocate per cpu arrays and also
avoids the 32 bytes per object times cpus that are mostly wasted for small
allocations today. So its going to potentially allow more per cpu objects
that available today.

A reasonable implementation for 64 bit is likely going to depend on
reserving some virtual memory space for the per cpu mappings so that they
can be dynamically grown up to what the reserved virtual space allows.

F.e. If we reserve 256G of virtual space and support a maximum of 16k cpus
then there is a limit on the per cpu space available of 16MB.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 02:50
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Fri, 02 Nov 2007 02:50:07 +0100
Lokalna: Pt 2 Lis 2007 02:50
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
Hmmm... On x86_64 we could take 8 terabyte virtual space (bit order 43)

With the worst case scenario of 16k of cpus (bit order 16) we are looking
at 43-16 = 27 ~ 128MB per cpu. Each percpu can at max be mapped by 64 pmd
entries. 4k support is actually max for projected hw. So we'd get
to 512M.

On IA64 we could take half of the vmemmap area which is 45 bits. So
we could get up to 512MB (with 16k pages, 64k pages can get us even
further) assuming we can at some point run 16 processors per node (4k is
the current max which would put the limit on the per cpu area >1GB).

Lets say you have a system with 64 cpus and an area of 128M of per cpu
storage. Then we are using 8GB of total memory for per cpu storage. The
128M allows us to store f.e.  16 M of word size counters.

With SLAB and the current allocpercpu you would need the following for
16M counters:

16M*32*64 (minimum alloc size of SLAB is 32 byte and we alloc via
                kmalloc) for the data.

16M*64*8 for the pointer arrays. 16M allocpercpu areas for 64 processors
                and a pointer size of 8 bytes.

So you would need to use 40G in current systems. The new scheme
would only need 8GB for the same amount of counters.

So I think its unreasonable to assume that currently systems exist that
can use more than 128m of allocpercpu space (assuming 64 cpus).

---
 include/asm-x86/pgtable_64.h |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6/include/asm-x86/pgtable_64.h
===================================================================
--- linux-2.6.orig/include/asm-x86/pgtable_64.h 2007-11-01 18:15:52.282577904 -0700
+++ linux-2.6/include/asm-x86/pgtable_64.h      2007-11-01 18:18:02.886979040 -0700
@@ -138,10 +138,14 @@ static inline pte_t ptep_get_and_clear_f
 #define VMALLOC_START    _AC(0xffffc20000000000, UL)
 #define VMALLOC_END      _AC(0xffffe1ffffffffff, UL)
 #define VMEMMAP_START   _AC(0xffffe20000000000, UL)
+#define PERCPU_START    _AC(0xfffff20000000000, UL)
+#define PERCPU_END      _AC(0xfffffa0000000000, UL)
 #define MODULES_VADDR    _AC(0xffffffff88000000, UL)
 #define MODULES_END      _AC(0xfffffffffff00000, UL)
 #define MODULES_LEN   (MODULES_END - MODULES_VADDR)

+#define PERCPU_MIN_SHIFT       PMD_SHIFT
+#define PERCPU_BITS            43
+
 #define _PAGE_BIT_PRESENT      0
 #define _PAGE_BIT_RW           1
 #define _PAGE_BIT_USER         2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
David Miller  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 04:00
Grupy dyskusyjne: linux.kernel
Od: David Miller <da...@davemloft.net>
Data: Fri, 02 Nov 2007 04:00:07 +0100
Lokalna: Pt 2 Lis 2007 04:00
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead
From: Christoph Lameter <clame...@sgi.com>
Date: Thu, 1 Nov 2007 18:06:17 -0700 (PDT)

> A reasonable implementation for 64 bit is likely going to depend on
> reserving some virtual memory space for the per cpu mappings so that they
> can be dynamically grown up to what the reserved virtual space allows.

> F.e. If we reserve 256G of virtual space and support a maximum of 16k cpus
> then there is a limit on the per cpu space available of 16MB.

Now that I understand your implementation better, yes this
sounds just fine.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Temat dyskusji zmieniono na „[RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead”" Peter Zijlstra
Peter Zijlstra  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 11:30
Grupy dyskusyjne: linux.kernel
Od: Peter Zijlstra <pet...@infradead.org>
Data: Fri, 02 Nov 2007 11:30:14 +0100
Lokalna: Pt 2 Lis 2007 11:30
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Thu, 2007-11-01 at 15:58 -0700, David Miller wrote:
> Since you're the one who wants to change the semantics and guarentees
> of this interface, perhaps it might help if you did some greps around
> the tree to see how alloc_percpu() is actually used.  That's what
> I did when I started running into trouble with your patches.

This fancy new BDI stuff also lives off percpu_counter/alloc_percpu().

That means that for example each NFS mount also consumes a number of
words - not quite sure from the top of my head how many, might be in the
order of 24 bytes or something.

I once before started looking at this, because the current
alloc_percpu() can have some false sharing - not that I have machines
that are overly bothered by that. I like the idea of a strict percpu
region, however do be aware of the users.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Temat dyskusji zmieniono na „[RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead”" Christoph Lameter
Christoph Lameter  
Wyświetl profil   Przetłumacz na język: Przetłumaczone (wyświetl oryginał)
 Więcej opcji 2 Lis 2007, 15:40
Grupy dyskusyjne: linux.kernel
Od: Christoph Lameter <clame...@sgi.com>
Data: Fri, 02 Nov 2007 15:40:08 +0100
Lokalna: Pt 2 Lis 2007 15:40
Temat: Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead

On Fri, 2 Nov 2007, Peter Zijlstra wrote:
> On Thu, 2007-11-01 at 15:58 -0700, David Miller wrote:

> > Since you're the one who wants to change the semantics and guarentees
> > of this interface, perhaps it might help if you did some greps around
> > the tree to see how alloc_percpu() is actually used.  That's what
> > I did when I started running into trouble with your patches.

> This fancy new BDI stuff also lives off percpu_counter/alloc_percpu().

Yes there are numerous uses. I even can increase page allocator
performance and reduce its memory footprint by using it here.

> That means that for example each NFS mount also consumes a number of
> words - not quite sure from the top of my head how many, might be in the
> order of 24 bytes or something.

> I once before started looking at this, because the current
> alloc_percpu() can have some false sharing - not that I have machines
> that are overly bothered by that. I like the idea of a strict percpu
> region, however do be aware of the users.

Well I wonder if I should introduce it not as a replacement but as an
alternative to allocpercpu? We can then gradually switch over. The
existing API does not allow the specification of gfp_masks or alignements.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


    Przekaż  
Aby wysyłać wiadomości, musisz się zalogować.
Musisz najpierw dołączyć do grupy, aby publikować w niej wiadomości.
Zaktualizuj swój pseudonim na stronie ustawienia subskrypcji przed wysłaniem wiadomości.
Nie masz wymaganego pozwolenia, aby publikować wiadomości.
Wiadomości  26  -  50  z  62   < Starsze  Nowsze >
« Powrót do dyskusji « Nowszy temat     Starszy temat »

Utwórz grupę - Grupy dyskusyjne - Google - strona główna - Warunki korzystania - Polityka prywatności
©2010 Google