Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp996458pxb; Thu, 4 Feb 2021 02:22:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJw44NOslyBUZPe2ygalvcDNNh6mzp59J3RNJjHU+TWtxOyaI6dNUYFbJ/HECcCHNhbtI0NL X-Received: by 2002:a17:906:145b:: with SMTP id q27mr6496826ejc.432.1612434143354; Thu, 04 Feb 2021 02:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612434143; cv=none; d=google.com; s=arc-20160816; b=CUSpdWTtzaHjY2DEhnr6yIVO4isLzm3owAWIEmNCsIezbj85FxepYmZqrOhciNOTDi +AKubk2FrXj1F9fyqb+mQWJ3Fg5w/vsxT8p034PlN6lMQrPDLEjCCB9NTkF3grLEVtDC XJ/daOqVg75Gey44LoXZN++geRObBN1doNc0hMoFVG9d6m0wycbS2GixlgUaHDefi7iV NmHIkArUhT/oVwTHW1MmBf/xYfCckEKgNF9ar4hodu8iPDFiCtKfrVCLNLnvaJviyW5m jrnUr6t3yLuTgD+PyCRAVxnvvhr9ngF33Wc4fePdQ++wNHboSBdh71YFQhajrtqyGo7N 23iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dteaa9WctumlnSF4vEfWhEQww005qkrMHIV+0A4eBtA=; b=l3GVJlBmdOyqJzEwayrdYnFkk5sL3glgUUu53jVq5KXBm7MCxcSBpXGQbItL3fd0Xo qXXMazL6wmSzmWpgguU2WzXE49i+Ic2bqGDEkKJStTeYViAKC0IBK0zx5/lBJXBB/60Y lBXE51pOEMyRCpgP51DV6OiaPKfHpv2/ngcNgiM+oqZsrcIUm632/FMhm5j2Wby6WlhT Zgxxh9ewB1pxRETvBQyFI6CcCSSXmVaIhOU59izhYMW/7DMrKuU+vQblgiOpqbKj3i0G R3aJRA3GXjLFjoLMInCiwTBfWLC9mAzkl7V3GeMrGNXHfyPLULzxwu/NTmeIWnjZoSyK zHCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kwLnqVci; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si2968647ejh.295.2021.02.04.02.21.58; Thu, 04 Feb 2021 02:22:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kwLnqVci; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235386AbhBDKVK (ORCPT + 99 others); Thu, 4 Feb 2021 05:21:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235329AbhBDKVF (ORCPT ); Thu, 4 Feb 2021 05:21:05 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58D4CC061573 for ; Thu, 4 Feb 2021 02:20:25 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id cl8so1442897pjb.0 for ; Thu, 04 Feb 2021 02:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dteaa9WctumlnSF4vEfWhEQww005qkrMHIV+0A4eBtA=; b=kwLnqVciucPAvi368GbGCaKJIsQwuQIBTaogGyWd0a6U86Tmba/Lnh/wP3ljFnAZuW RSLLJ+I6y4nNtYR8dJDzWHrSGIfPKJf4xOwwP4cH/7ZNsZ6ebREEnMmgMdTIKKJuDRUd Ir07V0gipzM4YFutoUHoYWInTioInsXMGcpicGH20GbHvP182bp82TurfdG01QRt+Y+D le1JEhB5IGJFNrblIPXQ3ogX2bkK3DxucdxhWYZY++siZ8pbHzGMTY1Nl1hTct1R8+Iw NSlcnx6u6xoBEFmjs9HWY9WKzJUGgqU0zlKJjaoKtQAHQhUd/MOrANqoVfxjdM4TpEmp oLVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dteaa9WctumlnSF4vEfWhEQww005qkrMHIV+0A4eBtA=; b=iYecqqsECzXYEYelt6VvX09+M9ic6IPFcP6Ypp5WZlahoqwIxFM23aJfFyKOpNRxPZ 0m8UmxzKb6il0JlmGjrWEdPmB+yhtPbM5ZaYi/SmfYuRcGSouNnHT1H+gbuKbApTdV9X 4zbpcjGskBQwKMWvGdd8xcg/5lHpPKVvOqOE1ElnhbqpeNmxSFtOL1KEraJ86u5grh25 biKZtQ6WbfrJbfdSoJ+fIDn5uEnrJB3gYtZLf5UqHhqM0Fel2fmkw316LxMJV8b/70zS mhavhfM6PMuT2wlX0OeMMpdQtPF233QO9EHFTVRjh7Ta3P0PZR6dDT0e7ts36ZRT3wxv nPtw== X-Gm-Message-State: AOAM5316AM6iJVfdvl4O2GMN8GsOzWbfPK1Cq+buT+qtQsqC97xsEMQW YOZg45kMuWe/7nbN5zTaSBY= X-Received: by 2002:a17:902:ea0f:b029:de:5fd5:abb9 with SMTP id s15-20020a170902ea0fb02900de5fd5abb9mr7327223plg.46.1612434024703; Thu, 04 Feb 2021 02:20:24 -0800 (PST) Received: from localhost (121-45-171-254.tpgi.com.au. [121.45.171.254]) by smtp.gmail.com with ESMTPSA id 123sm5363785pfd.91.2021.02.04.02.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 02:20:23 -0800 (PST) Date: Thu, 4 Feb 2021 21:20:20 +1100 From: Balbir Singh To: Weiping Zhang Cc: sblbir@amazon.com, davem@davemloft.net, Linux Kernel Mailing List Subject: Re: [RFC PATCH v2] taskstats: add /proc/taskstats to fetch pid/tgid status Message-ID: <20210204102020.GA286763@balbir-desktop> References: <20201217170009.GA29186@192.168.3.9> <20210127111346.GB59838@balbir-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 31, 2021 at 05:16:47PM +0800, Weiping Zhang wrote: > On Wed, Jan 27, 2021 at 7:13 PM Balbir Singh 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 wrote: > > > > > > > > Hi David, > > > > > > > > Could you help review this patch ? > > > > > > > > thanks > > > > > > > > On Fri, Dec 18, 2020 at 1:24 AM Weiping Zhang > > > > 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 > > > > 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 > Let me try it out, I am opposed to adding the new IOCTL interface you propose. How frequently do you monitor this data and how much time in spent in making decision on the data? I presume the data mentioned is the cost per call in seconds? Balbir Singh