lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180118161238.13792-1-dima@arista.com>
Date:   Thu, 18 Jan 2018 16:12:32 +0000
From:   Dmitry Safonov <dima@...sta.com>
To:     linux-kernel@...r.kernel.org
Cc:     Dmitry Safonov <dima@...sta.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Miller <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Frederic Weisbecker <fweisbec@...il.com>,
        Hannes Frederic Sowa <hannes@...essinduktion.org>,
        Ingo Molnar <mingo@...nel.org>,
        "Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Mauro Carvalho Chehab <mchehab@...pensource.com>,
        Mike Galbraith <efault@....de>,
        Paolo Abeni <pabeni@...hat.com>,
        "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Radu Rendec <rrendec@...sta.com>,
        Rik van Riel <riel@...hat.com>,
        Stanislaw Gruszka <sgruszka@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Wanpeng Li <wanpeng.li@...mail.com>
Subject: [RFC 0/6] Multi-thread per-cpu ksoftirqd

Another attempt to solve softirq deferring problems.
There are at least two problems, AFAIK:
o deferring one softirq to ksoftirqd results in latencies for other
  (different type) softirqs by the reason of ksoftirqd_running()
  decision for deferring/servicing.
o The logic in __do_softirq() that checks if (pending) after 2ms of
  processing doesn't work on some machines during i.e. UDP storm.

So, what's done here in attempt to improve this is:
- added boot param to separate softirqs in deffer-groups
- per each softirq-group there is a ksoftirqd (per-cpu also)

The last two patches might be just a brain fart as I tried to improve
the metric on which the decision to defer is based.
I measure the time spent to serve each softirq and account that time
to ksoftirqd thread of that softirq-group. After that the decision
to serve/defer a softirq is based on the comparison:
(current->vruntime < ksoftirqd->vruntime)
Ugh, time measures and updating ksoftirqd cpu time each tick might be
costly.. And it looks like it doesn't work as expected: a new task is
being started with normalized vruntime (min_vruntime), which is lower
than ksoftirqd's. And time spent on servicing softirqs are still bigger
than any running task.
Anyway, sending this as RFC, may be some one will like the approach
(or suggests some other ideas).

Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: David Miller <davem@...emloft.net>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: "Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com> 
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mauro Carvalho Chehab <mchehab@...pensource.com>
Cc: Mike Galbraith <efault@....de>
Cc: Paolo Abeni <pabeni@...hat.com>
Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com> 
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Radu Rendec <rrendec@...sta.com>
Cc: Rik van Riel <riel@...hat.com>
Cc: Stanislaw Gruszka <sgruszka@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Wanpeng Li <wanpeng.li@...mail.com>

Dmitry Safonov (6):
  softirq: Add softirq_groups boot parameter
  softirq: Introduce mask for __do_softirq()
  softirq: Add reverse group-to-softirq map
  softirq: Run per-group per-cpu ksoftirqd thread
  softirq: Add time accounting per-softirq type
  softirq/sched: Account si cpu time to ksoftirqd(s)

 Documentation/admin-guide/kernel-parameters.txt |  16 ++
 include/linux/hardirq.h                         |   2 +-
 include/linux/interrupt.h                       |  26 +-
 include/linux/vtime.h                           |  10 +-
 init/Kconfig                                    |  10 +
 kernel/sched/cputime.c                          |  60 +++-
 kernel/sched/fair.c                             |  38 +++
 kernel/sched/sched.h                            |  20 ++
 kernel/softirq.c                                | 362 ++++++++++++++++++++----
 net/ipv4/tcp_output.c                           |   2 +-
 10 files changed, 464 insertions(+), 82 deletions(-)

-- 
2.13.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ