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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA70yB6P4_JsZnCrBkYg=7eyT5KW0XucUY+Y7T8YYMnXj6iVXA@mail.gmail.com>
Date:   Sun, 31 Jan 2021 17:16:47 +0800
From:   Weiping Zhang <zwp10758@...il.com>
To:     Balbir Singh <bsingharora@...il.com>
Cc:     sblbir@...zon.com, davem@...emloft.net,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2] taskstats: add /proc/taskstats to fetch pid/tgid status

On Wed, Jan 27, 2021 at 7:13 PM Balbir Singh <bsingharora@...il.com> wrote:
>
> On Fri, Jan 22, 2021 at 10:07:50PM +0800, Weiping Zhang wrote:
> > Hello Balbir Singh,
> >
> > Could you help review this patch, thanks
> >
> > On Mon, Dec 28, 2020 at 10:10 PM Weiping Zhang <zwp10758@...il.com> wrote:
> > >
> > > Hi David,
> > >
> > > Could you help review this patch ?
> > >
> > > thanks
> > >
> > > On Fri, Dec 18, 2020 at 1:24 AM Weiping Zhang
> > > <zhangweiping@...iglobal.com> wrote:
> > > >
> > > > If a program needs monitor lots of process's status, it needs two
> > > > syscalls for every process. The first one is telling kernel which
> > > > pid/tgid should be monitored by send a command(write socket) to kernel.
> > > > The second one is read the statistics by read socket. This patch add
> > > > a new interface /proc/taskstats to reduce two syscalls to one ioctl.
> > > > The user just set the target pid/tgid to the struct taskstats.ac_pid,
> > > > then kernel will collect statistics for that pid/tgid.
> > > >
> > > > Signed-off-by: Weiping Zhang <zhangweiping@...iglobal.com>
>
> Could you elaborate on the overhead your seeing for the syscalls? I am not
> in favour of adding new IOCTL's.
>
> Balbir Singh.

Hello Balbir Singh,

Sorry for late reply,

I do a performance test between netlink mode and ioctl mode,
monitor 1000 and 10000 sleep processes,
the netlink mode cost more time than ioctl mode, that is to say
ioctl mode can save some cpu resource and has a quickly reponse
especially when monitor lot of process.

proccess-count    netlink         ioctl
---------------------------------------------
1000              0.004446851     0.001553733
10000             0.047024986     0.023290664

you can get the test demo code from the following link
https://github.com/dublio/tools/tree/master/c/taskstat

Thanks
Weiping

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ