• Jiri Kosina's avatar
    sched: move rq_weight data array out of .percpu · 4a6cc4bd
    Jiri Kosina authored
    Commit 34d76c41 introduced percpu array update_shares_data, size of which
    being proportional to NR_CPUS. Unfortunately this blows up ia64 for large
    NR_CPUS configuration, as ia64 allows only 64k for .percpu section.
    
    Fix this by allocating this array dynamically and keep only pointer to it
    percpu.
    
    The per-cpu handling doesn't impose significant performance penalty on
    potentially contented path in tg_shares_up().
    
    ...
    ffffffff8104337c:       65 48 8b 14 25 20 cd    mov    %gs:0xcd20,%rdx
    ffffffff81043383:       00 00
    ffffffff81043385:       48 c7 c0 00 e1 00 00    mov    $0xe100,%rax
    ffffffff8104338c:       48 c7 45 a0 00 00 00    movq   $0x0,-0x60(%rbp)
    ffffffff81043393:       00
    ffffffff81043394:       48 c7 45 a8 00 00 00    movq   $0x0,-0x58(%rbp)
    ffffffff8104339b:       00
    ffffffff8104339c:       48 01 d0                add    %rdx,%rax
    ffffffff8104339f:       49 8d 94 24 08 01 00    lea    0x108(%r12),%rdx
    ffffffff810433a6:       00
    ffffffff810433a7:       b9 ff ff ff ff          mov    $0xffffffff,%ecx
    ffffffff810433ac:       48 89 45 b0             mov    %rax,-0x50(%rbp)
    ffffffff810433b0:       bb 00 04 00 00          mov    $0x400,%ebx
    ffffffff810433b5:       48 89 55 c0             mov    %rdx,-0x40(%rbp)
    ...
    
    After:
    
    ...
    ffffffff8104337c:       65 8b 04 25 28 cd 00    mov    %gs:0xcd28,%eax
    ffffffff81043383:       00
    ffffffff81043384:       48 98                   cltq
    ffffffff81043386:       49 8d bc 24 08 01 00    lea    0x108(%r12),%rdi
    ffffffff8104338d:       00
    ffffffff8104338e:       48 8b 15 d3 7f 76 00    mov    0x767fd3(%rip),%rdx        # ffffffff817ab368 <update_shares_data>
    ffffffff81043395:       48 8b 34 c5 00 ee 6d    mov    -0x7e921200(,%rax,8),%rsi
    ffffffff8104339c:       81
    ffffffff8104339d:       48 c7 45 a0 00 00 00    movq   $0x0,-0x60(%rbp)
    ffffffff810433a4:       00
    ffffffff810433a5:       b9 ff ff ff ff          mov    $0xffffffff,%ecx
    ffffffff810433aa:       48 89 7d c0             mov    %rdi,-0x40(%rbp)
    ffffffff810433ae:       48 c7 45 a8 00 00 00    movq   $0x0,-0x58(%rbp)
    ffffffff810433b5:       00
    ffffffff810433b6:       bb 00 04 00 00          mov    $0x400,%ebx
    ffffffff810433bb:       48 01 f2                add    %rsi,%rdx
    ffffffff810433be:       48 89 55 b0             mov    %rdx,-0x50(%rbp)
    ...
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    4a6cc4bd
sched.c 266 KB