Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3197569ybz; Sun, 19 Apr 2020 20:29:38 -0700 (PDT) X-Google-Smtp-Source: APiQypK9XRce9J/ZKzCqsqT/EfzNkoyYBhjV4dVINQHJKneIRhipHs8YuqAUyro4dqFZ8ORCDRlb X-Received: by 2002:a17:906:770b:: with SMTP id q11mr6062488ejm.224.1587353378408; Sun, 19 Apr 2020 20:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587353378; cv=none; d=google.com; s=arc-20160816; b=iAXeJuSQqrqTUGil9PKyQNsr6n1RQvwDloMhgCl7V009aIrF8XH8UgnMp+vTBzecbY fyNyWBl/lmb29415voIEVdfH7q/8m39NmN0yDM0V4kGQl2YS6cjhg4Bhkx5pA9QKIXGo ajLVeZYSfgUbSOGclZ+PVlfTltLsvfuc+DXxN2SPBhwvx8gi2ENDYkl48B+jDkJHQ5aS ZVF4D5sWIMnpj6sMspiuuATGo4q/IufaKzSOHkh7925QXVY3fw7x0BGP40B4U/5sTLu4 MhSBoEO5ArWAyY1z1PF4pm4o9J0em89g8hW1IiWgjh6jlx9uWucjWDqDPKWhjuID2buy ZlVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=z8seqfwZtdzPv1rV3U1QbzPWhKeVPiy7xBdSt38fXOE=; b=ooCTaHFj2H7QdXwuUF169dpxkpkAh+FPm/Mr9z2Y0Q4heAdxcoIpr9OUVOe1f19aTc EcKV0CZ8cxvBzjAmNdadTkA/agdgcsjLp4v0clXzXG5pOwmZPXmikuGZiXgqtg+4Dko9 td4Q5fRvTJvId/Jhbskz852jYgujdgLuMAxbDghzN99sMvhU2GpO7FbHjbL/0InmzXvV QmInOXvrHKgN/C8+Tmhwnmep6PEel4/Byoqyc+1Kp4I314vjxouQTQI4LRVAEOgAiOWL wKnPhO8TXjfnaGj+PDI9xKvuz+M1jDIzbwNL1C90mL6hseliC1L4oqisLlH/3qwt9OLh oqLQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oj19si18877520ejb.22.2020.04.19.20.29.00; Sun, 19 Apr 2020 20:29:38 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbgDTD0t (ORCPT + 99 others); Sun, 19 Apr 2020 23:26:49 -0400 Received: from mga12.intel.com ([192.55.52.136]:6246 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgDTD0t (ORCPT ); Sun, 19 Apr 2020 23:26:49 -0400 IronPort-SDR: 98Rb07V6QK9PPrQ0WqEam7u24KdCdJDl4CVkVMWEMOiLOPnmhsVxbLhsgCyRDQsDW8uiHMLzG4 S/cKV03Pe/MQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2020 20:26:46 -0700 IronPort-SDR: 3ivqihb11g1hPSROSw4eMzCqTmuhzzMlOVw2DRnhT5NpR2CQeh2GG5FmuRe6jyDnydFbaMACPt loMEBUQ7JLnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,405,1580803200"; d="scan'208";a="245236913" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by fmsmga007.fm.intel.com with ESMTP; 19 Apr 2020 20:26:41 -0700 From: "Huang\, Ying" To: Peter Zijlstra Cc: Mel Gorman , , , Ingo Molnar , Mel Gorman , Rik van Riel , Daniel Jordan , Tejun Heo , Dave Hansen , Tim Chen , Aubrey Li Subject: Re: [RFC] autonuma: Support to scan page table asynchronously References: <20200414081951.297676-1-ying.huang@intel.com> <20200414120646.GN3818@techsingularity.net> <20200415113226.GE20730@hirez.programming.kicks-ass.net> <87o8rsxlws.fsf@yhuang-dev.intel.com> <20200417100633.GU20730@hirez.programming.kicks-ass.net> Date: Mon, 20 Apr 2020 11:26:40 +0800 In-Reply-To: <20200417100633.GU20730@hirez.programming.kicks-ass.net> (Peter Zijlstra's message of "Fri, 17 Apr 2020 12:06:33 +0200") Message-ID: <87368yu9an.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra writes: > On Thu, Apr 16, 2020 at 09:24:35AM +0800, Huang, Ying wrote: >> Peter Zijlstra writes: >> >> > On Tue, Apr 14, 2020 at 01:06:46PM +0100, Mel Gorman wrote: >> >> While it's just an opinion, my preference would be to focus on reducing >> >> the cost and amount of scanning done -- particularly for threads. >> > >> > This; I really don't believe in those back-charging things, esp. since >> > not having cgroups or having multiple applications in a single cgroup is >> > a valid setup. >> >> Technically, it appears possible to back-charge the CPU time to the >> process/thread directly (not the cgroup). > > I've yet to see a sane proposal there. What we're not going to do is > make regular task accounting more expensive than it already is. Yes. There's overhead to back-charge. To reduce the overhead, instead of back-charge immediately, we can - Add one field to task_struct, say backcharge_time, to track the delayed back-charged CPU time. - When the work item completes its work, add the CPU time it spends to task_struct->backcharge_time atomically - When the task account CPU regularly, e.g. in scheduler_tick(), task_struct->backcharge is considered too. Although this cannot eliminate the overhead, it can reduce it. Do you think this is acceptable or not? Best Regards, Huang, Ying