[Devel] [PATCH vz7 2/2] relay: use kvzalloc for rchan structure allocation

Andrey Ryabinin aryabinin at virtuozzo.com
Tue May 8 15:50:54 MSK 2018



On 05/08/2018 03:30 PM, Oleg Babin wrote:
> Size of rchan structure depends on NR_CPUS definition which can be
> configured by the user and can become quite large.
> 
> E.g. if NR_CPUS equals to 5120 (real world scenario) then it makes
> sizeof(struct rchan) == 41320 meaning the 4th memory order.
> 
> Use kvmalloc() for rchan structure allocation to fallback to vmalloc()
> in case of high order page is not available at the moment.
> 
> https://jira.sw.ru/browse/HCI-53
> Signed-off-by: Oleg Babin <obabin at virtuozzo.com>
> ---


017c59c042d01fc84cae7a8ea475861e702c77ab
Author: Akash Goel <akash.goel at intel.com>
Date:   Fri Sep 2 21:47:38 2016 +0200

    relay: Use per CPU constructs for the relay channel buffer pointers
    
    relay essentially needs to maintain a per CPU array of channel buffer
    pointers but it manually creates that array.  Instead its better to use
    the per CPU constructs, provided by the kernel, to allocate & access the
    array of pointer to channel buffers.
    
    Signed-off-by: Akash Goel <akash.goel at intel.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
    Link: http://lkml.kernel.org/r/1470909140-25919-1-git-send-email-akash.goel@intel.com
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: Thomas Gleixner <tglx at linutronix.de>





More information about the Devel mailing list