From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7814C54FC9 for ; Mon, 20 Apr 2020 03:26:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A46C1214AF for ; Mon, 20 Apr 2020 03:26:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A46C1214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 332DC8E0005; Sun, 19 Apr 2020 23:26:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E2C68E0003; Sun, 19 Apr 2020 23:26:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F96D8E0005; Sun, 19 Apr 2020 23:26:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 08B7F8E0003 for ; Sun, 19 Apr 2020 23:26:48 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C0E624DD0 for ; Mon, 20 Apr 2020 03:26:47 +0000 (UTC) X-FDA: 76726796454.13.turn14_1e24c09129925 X-HE-Tag: turn14_1e24c09129925 X-Filterd-Recvd-Size: 3436 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 03:26:46 +0000 (UTC) IronPort-SDR: qWvTv4VA0yup+49f3GdAobcuQRmBKGjEM6F8NkY066WePMmaRfh4tYibcT4XZF4iDAv37XsjaB FUZHXg8sfHzA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2020 20:26:45 -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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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