Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2582790ybt; Mon, 22 Jun 2020 02:00:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9LGn5DA+LXvTEKYY1jBfsjyAjyccr6Veyh5ye5XNYyQc2Bdo45QZ2IawFU0MoxInd5YGS X-Received: by 2002:a50:f694:: with SMTP id d20mr15367268edn.171.1592816430662; Mon, 22 Jun 2020 02:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592816430; cv=none; d=google.com; s=arc-20160816; b=iJc4GMfpRBe6lvEQF9nm0enAUaYplIbsLPeFX3e8qAaL8nM+CTjH5ii3Oxg0LPu/g6 XTrf+wx84lE3p/cbV6PCzRTVciIPHLkzuB2itxfSMmAPAjndLnp2X2Ea+p2XN+SpJnOL IENzZQlquc6IAS3A/twAGx0OiWnMkwtX47kJq0PQLopgYb7X6GKZTy/iusYejwFQnW9N DoNn2wrRZfe4H7l5pak4yupxkcG1SoLZe3cV2cbQkkaq6sF8L3ZCXFNEuoQbOE4N04T7 kWNGq9fW0wDboU0ggOUUt1JOleqXboyo8kbX0WCwOXNhGfjcbY8XNC6Dq1PxJz0+TMH7 ll5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=plfk8SR1weWMwKuSu8qg+BrN7t/XluX9JixL+iwR6Yw=; b=MILR775sI4MC8EGBx5hmPyxSzyenAlBhUH0CBUqWvSbXQe9gfY+8Dx6v64mbMiLGaJ 4VGVPrjgs6RVm3aX6vqI/Oc2WDPcwjhn8t90qsa/lu1JWD9P0SMggYkEuMoOFqHDhe1O GksV+ESCVymWNu6v49nYx/B1LejRE3+lSyQZFR9V4egZqzfZ5W72ysKnmpdAMPf+8N6H K++ldy2zNlKeGmZnuTPqnDhjYctFYQFxWjjMQlLqvc0yWF0i8KyCGEdV6T7lQXjEIA5b 1K2MWGyF1VdAFXlmWvx7mDMF049zS+WnLQzDpyjos35gWFc/yTiOMAEA7D70UlrA+bTR mX9A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si9455824edp.99.2020.06.22.02.00.08; Mon, 22 Jun 2020 02:00:30 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725930AbgFVI6M (ORCPT + 99 others); Mon, 22 Jun 2020 04:58:12 -0400 Received: from outbound-smtp32.blacknight.com ([81.17.249.64]:44972 "EHLO outbound-smtp32.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgFVI6L (ORCPT ); Mon, 22 Jun 2020 04:58:11 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp32.blacknight.com (Postfix) with ESMTPS id D29F0BECB9 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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