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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 E5F05C63798 for ; Thu, 26 Nov 2020 15:23:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 663D5221F8 for ; Thu, 26 Nov 2020 15:23:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 663D5221F8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 96F726B0078; Thu, 26 Nov 2020 10:23:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 91E8F6B007B; Thu, 26 Nov 2020 10:23:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85CF86B007D; Thu, 26 Nov 2020 10:23:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 71D3E6B0078 for ; Thu, 26 Nov 2020 10:23:47 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 27387363E for ; Thu, 26 Nov 2020 15:23:47 +0000 (UTC) X-FDA: 77526939294.10.love56_1e086e627380 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 010ED16A0B9 for ; Thu, 26 Nov 2020 15:23:46 +0000 (UTC) X-HE-Tag: love56_1e086e627380 X-Filterd-Recvd-Size: 3792 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Nov 2020 15:23:46 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 46064ACC4; Thu, 26 Nov 2020 15:23:45 +0000 (UTC) To: Alex Shi , Andrew Morton Cc: Matthew Wilcox , Hugh Dickins , Yu Zhao , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1605859413-53864-1-git-send-email-alex.shi@linux.alibaba.com> <20201120151307.4d9e3ef092ba01a325db7ce2@linux-foundation.org> <20201122123552.GF4327@casper.infradead.org> <728874d7-2d93-4049-68c1-dcc3b2d52ccd@linux.alibaba.com> <46ad053f-1401-31e8-50cf-09acda588f6f@suse.cz> <20201125154346.b2032c39cf3905bbebec3322@linux-foundation.org> From: Vlastimil Babka Subject: Re: [PATCH next] mm/vmscan: __isolate_lru_page_prepare clean up Message-ID: <2ba66325-e3c8-d809-a8dd-85af77c3904b@suse.cz> Date: Thu, 26 Nov 2020 16:23:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 11/26/20 3:25 AM, Alex Shi wrote: >=20 >=20 > =D4=DA 2020/11/26 =C9=CF=CE=E77:43, Andrew Morton =D0=B4=B5=C0: >> On Tue, 24 Nov 2020 12:21:28 +0100 Vlastimil Babka wr= ote: >>=20 >>> On 11/22/20 3:00 PM, Alex Shi wrote: >>>> Thanks a lot for all comments, I picked all up and here is the v3: >>>> >>>> From 167131dd106a96fd08af725df850e0da6ec899af Mon Sep 17 00:00:00 2= 001 >>>> From: Alex Shi >>>> Date: Fri, 20 Nov 2020 14:49:16 +0800 >>>> Subject: [PATCH v3 next] mm/vmscan: __isolate_lru_page_prepare clean= up >>>> >>>> The function just return 2 results, so use a 'switch' to deal with i= ts >>>> result is unnecessary, and simplify it to a bool func as Vlastimil >>>> suggested. >>>> >>>> Also remove 'goto' by reusing list_move(), and take Matthew Wilcox's >>>> suggestion to update comments in function. >>> >>> I wouldn't mind if the goto stayed, but it's not repeating that much=20 >>> without it (list_move() + continue, 3 times) so... >>=20 >> I tried that, and .text became significantly larger, for reasons which >> I didn't investigate ;) I found out that comparing whole .text doesn't often work as changes migh= t be lost in alignment, or once in a while cross the alignment boundary and become exagerated. bloat= -o-meter works nice though. > Uh, BTW, with the gcc 8.3.1 and centos 7, goto or continue version has = same size > on my side with or w/o DEBUG_LIST. But actually, this clean up patch co= uld > add 10 bytes also with or w/o DEDBUG_LIST. >=20 > Maybe related with different compiler? gcc (SUSE Linux) 10.2.1 20201117 [revision 98ba03ffe0b9f37b4916ce6238fad7= 54e00d720b] ./scripts/bloat-o-meter vmscan.o.before mm/vmscan.o add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-1 (-1) Function old new delta isolate_lru_pages 1125 1124 -1 Total: Before=3D57283, After=3D57282, chg -0.00% Not surprising, as I'd expect the compiler to figure out by itself that l= ist_move + continue repeats and can be unified. The reason for goto to stay would be rather = readability (subjective). > Thanks > Alex >=20