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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 61353C433F5 for ; Fri, 24 Sep 2021 14:11:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0A85661164 for ; Fri, 24 Sep 2021 14:11:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0A85661164 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 654B3900004; Fri, 24 Sep 2021 10:11:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 604F2900002; Fri, 24 Sep 2021 10:11:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F2B7900004; Fri, 24 Sep 2021 10:11:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 3FF6E900002 for ; Fri, 24 Sep 2021 10:11:24 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BC54D82499A8 for ; Fri, 24 Sep 2021 14:11:23 +0000 (UTC) X-FDA: 78622654446.24.13479BB Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf23.hostedemail.com (Postfix) with ESMTP id 497509000093 for ; Fri, 24 Sep 2021 14:11:23 +0000 (UTC) Received: from relay1.suse.de (relay1.suse.de [149.44.160.133]) by smtp-out1.suse.de (Postfix) with ESMTP id D935E22429; Fri, 24 Sep 2021 14:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1632492681; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xptrUF64qS+6u7xLV3tWOmzw4bsvaWDSNFYfVdST24M=; b=picfxz/elp6W9f7CrwEaQtXFpVHkQ2uj6HVogFSG1fbe3TZ6Rp4MRjWYdS5gaBAaz8eySa xry+lDDpqV1kUX56tSodaps3toJJXLjQ2T01KVkKlU2muVl907c/RGZT8ulP0oAIHJ8nlA IKuWE5zGXaNvMWoQnX0qayxiW3eIzFU= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay1.suse.de (Postfix) with ESMTPS id 684F525EB2; Fri, 24 Sep 2021 14:11:21 +0000 (UTC) Date: Fri, 24 Sep 2021 16:11:21 +0200 From: Michal Hocko To: yongw.pur@gmail.com Cc: tj@kernel.org, peterz@infradead.org, wang.yong12@zte.com.cn, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, yang.yang29@zte.com.cn Subject: Re: [PATCH v3] vmpressure: wake up work only when there is registration event Message-ID: References: <1632491065-10785-1-git-send-email-wang.yong12@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1632491065-10785-1-git-send-email-wang.yong12@zte.com.cn> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 497509000093 X-Stat-Signature: oesj1soj4hkza1o5eaxtqo8gf8ec7w37 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="picfxz/e"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf23.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1632492683-345743 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: On Fri 24-09-21 06:44:25, yongw.pur@gmail.com wrote: > From: wangyong > > Use the global variable num_events to record the number of vmpressure > events registered by the system, and wake up work only when there > is registration event. > Usually, the vmpressure event is not registered in the system, this patch > can avoid waking up work and doing nothing. > > Test with 5.14.0-rc5-next-20210813 on x86_64 4G ram. > Consume cgroup memory until it is about to be reclaimed, then execute > "perf stat -I 2000 malloc.out" command to trigger memory reclamation > and get performance results. > The context-switches is reduced by about 20 times. > > unpatched: > Average of 10 test results > 582.4674048 task-clock(msec) > 19910.8 context-switches > 0 cpu-migrations > 1292.9 page-faults > 414784733.1 cycles > 580070698.4 instructions > 125572244.7 branches > 2073541.2 branch-misses > > patched: > Average of 10 test results > 973.6174796 task-clock(msec) > 988.6 context-switches > 0 cpu-migrations > 1785.2 page-faults > 772883602.4 cycles > 1360280911 instructions > 290519434.9 branches > 3378378.2 branch-misses Your data still doesn't make any sense. I have asked about that in the previous submission and you haven't really clarified anything. How come your task-clock has almost doubled. You are likely not not comparing apples to apples or something weird is going on. This patch is not going to fly without a sensible data and analysis of that data. Thanks! -- Michal Hocko SUSE Labs