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.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 22787C433DF for ; Mon, 22 Jun 2020 08:58:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DFCC320708 for ; Mon, 22 Jun 2020 08:58:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFCC320708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7628E6B0003; Mon, 22 Jun 2020 04:58:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7133C6B0005; Mon, 22 Jun 2020 04:58:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 602666B0007; Mon, 22 Jun 2020 04:58:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 573A26B0003 for ; Mon, 22 Jun 2020 04:58:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 198ED1EF1 for ; Mon, 22 Jun 2020 08:58:12 +0000 (UTC) X-FDA: 76956246024.10.bait79_2f0653326e31 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id AA87516A0BE for ; Mon, 22 Jun 2020 08:58:11 +0000 (UTC) X-HE-Tag: bait79_2f0653326e31 X-Filterd-Recvd-Size: 2819 Received: from outbound-smtp44.blacknight.com (outbound-smtp44.blacknight.com [46.22.136.52]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Mon, 22 Jun 2020 08:58:11 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp44.blacknight.com (Postfix) with ESMTPS id D488AF8388 for ; Mon, 22 Jun 2020 09:58:09 +0100 (IST) Received: (qmail 27448 invoked from network); 22 Jun 2020 08:58:09 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.18.5]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 22 Jun 2020 08:58:09 -0000 Date: Mon, 22 Jun 2020 09:58:08 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Hugh Dickins , akpm@linux-foundation.org, alex.shi@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, liwang@redhat.com Subject: Re: [PATCH 2/2] mm, page_alloc: use unlikely() in task_capc() Message-ID: <20200622085808.GP3183@techsingularity.net> References: <20200616082649.27173-1-vbabka@suse.cz> <20200616082649.27173-2-vbabka@suse.cz> <4a24f7af-3aa5-6e80-4ae6-8f253b562039@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4a24f7af-3aa5-6e80-4ae6-8f253b562039@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: AA87516A0BE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Wed, Jun 17, 2020 at 11:55:07AM +0200, Vlastimil Babka wrote: > > > It makes no difference, at least on my gcc10 which seems to be smart enough to > do the right thing. But yeah, your suggestion is more readable and precise and > maybe can work better with a less smart compiler. Thanks. > > ----8<---- > From 615eea6f6abe288ffb708aa0d1bdfbeaf30a4cbd Mon Sep 17 00:00:00 2001 > From: Vlastimil Babka > Date: Tue, 16 Jun 2020 10:14:47 +0200 > Subject: [PATCH] mm, page_alloc: use unlikely() in task_capc() > > Hugh noted that task_capc() could use unlikely(), as most of the time there is > no capture in progress and we are in page freeing hot path. Indeed adding > unlikely() produces assembly that better matches the assumption and moves > all the tests away from the hot path. > > I have also noticed that we don't need to test for cc->direct_compaction as the > only place we set current->task_capture is compact_zone_order() which also > always sets cc->direct_compaction true. > > Suggested-by: Hugh Dickins > Signed-off-by: Vlastimil Babka > Acked-by: Hugh Dickins Acked-by: Mel Gorman -- Mel Gorman SUSE Labs