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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82492C433F5 for ; Fri, 8 Oct 2021 11:47:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8F7D60F5E for ; Fri, 8 Oct 2021 11:47:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B8F7D60F5E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 05905900002; Fri, 8 Oct 2021 07:47:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0085A6B0072; Fri, 8 Oct 2021 07:47:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3959900002; Fri, 8 Oct 2021 07:47:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id D45326B0071 for ; Fri, 8 Oct 2021 07:47:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 86F331839ADA1 for ; Fri, 8 Oct 2021 11:47:03 +0000 (UTC) X-FDA: 78673093926.26.376CFF9 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf26.hostedemail.com (Postfix) with ESMTP id EA9D8200B388 for ; Fri, 8 Oct 2021 11:47:02 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6A0E320120; Fri, 8 Oct 2021 11:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1633693621; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YoxW4EUonCWf2lBt5f9S3iKvB1ejzJVPxoUC2rO4AkI=; b=1ZcyaUI9xL0W6i8yX8fh3JwbqEunlXFB9R5Hp4A3vr8ms486M4COzbyQRsWP+KlLwyB6dh dGaXSFSFDN4d5nEVPhN+r4zSGmKnNwJv+aM9LS/ZyZArn593oBkmU1FM8LbR8KuVBUobD1 yNeUmEVBsrzS2avT2ueUr8fTq1gAZDE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1633693621; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YoxW4EUonCWf2lBt5f9S3iKvB1ejzJVPxoUC2rO4AkI=; b=97hilA7zf9D+z7paBomgPpHZSwUGYILNLuMasBPsLrjC2yAu9fTQr3pifWwzZtN5UvLFl5 +se0dSDU+VEB5VBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 36BDC13EC3; Fri, 8 Oct 2021 11:47:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PXuXCrUvYGE2QAAAMHmgww (envelope-from ); Fri, 08 Oct 2021 11:47:01 +0000 Message-ID: <29155011-f884-b0e5-218e-911039568acb@suse.cz> Date: Fri, 8 Oct 2021 13:47:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH memcg] mm/page_alloc.c: avoid statistic update with 0 Content-Language: en-US To: Vasily Averin , Michal Hocko Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org, Mel Gorman , Uladzislau Rezki References: From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EA9D8200B388 X-Stat-Signature: d1dr3cp3aonoue9c3azxgdz8kezzypih Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=1ZcyaUI9; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=97hilA7z; dmarc=none; spf=pass (imf26.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-HE-Tag: 1633693622-345601 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 10/8/21 11:24, Vasily Averin wrote: > __alloc_pages_bulk can call __count_zid_vm_events and zone_statistics > with nr_account = 0. But that's not a bug, right? Just an effective no-op that's not commonly happening, so is it worth the check? > Fixes: 3e23060b2d0b ("mm/page_alloc: batch the accounting updates in the bulk allocator") > Signed-off-by: Vasily Averin > --- > mm/page_alloc.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 602819a232e5..e67113452ee8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5364,9 +5364,10 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid, > } > > local_unlock_irqrestore(&pagesets.lock, flags); > - > - __count_zid_vm_events(PGALLOC, zone_idx(zone), nr_account); > - zone_statistics(ac.preferred_zoneref->zone, zone, nr_account); > + if (nr_account) { > + __count_zid_vm_events(PGALLOC, zone_idx(zone), nr_account); > + zone_statistics(ac.preferred_zoneref->zone, zone, nr_account); > + } > if (objcg) > memcg_bulk_post_charge_hook(objcg, nr_pre_charge - nr_account); > >