Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1326317pxu; Fri, 16 Oct 2020 09:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze28b2kfjrlTt5HPpW5drSMmR87TNNBRd/BiNzGEKX3NeI3tRI/6vDNMzKUOK2ioyZqUff X-Received: by 2002:aa7:c2d9:: with SMTP id m25mr4987821edp.226.1602864833095; Fri, 16 Oct 2020 09:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602864833; cv=none; d=google.com; s=arc-20160816; b=AaO/QRcljjnRBVWGWhEgLyQMH/szQLA9D36imbRGIIbhtFNw6ChNEI2mTjIL4F3Sqn GomtAk0/lXA50h6/dsJLV0gTbIv+bY/UFqmPbwGgK6a0IZcLjcZdMBXgmVO9TZWH1cSu cKs8FNjpOlVrw6A1vbVVAdegel5qwq/w9D+phwo0nf+U+bXGsz4LdAND/wmoTqiKhyq8 e/2bq9kQr5e+sXOYCfArsyFX4gAeRneCR+n/e1FM6NolEG0qV2kpP0E7Y8X5VNDHb415 sU3tkRiV1Nj4E0gbN/LDXz+5FYuGx3Ug3q5tpIjlInG5r+STlcsT9zw6zA+Xto0k21kk Ad2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=1BQPDJcj3Y88csUvk4nt/9iyzpcZytzLYzQQnKU7qgE=; b=I6thx+jaqocvmsZeuG2RSvQVv22yYO8VW+Rc2wbXUG9YsfwgexCR7NcS5SnVV/NcT9 wgY+ND6HUcjn+mgJ/NCQTjyeM5ReDA2pyiMrNCBrw1CIbJGTiBDBVrziw6oe76fAXue1 4ruCeDm456PA+dvF3uarOmfcfove1VLT2e6hxr9hHDccXQgmGt1XZrGTieAkwa6BxopY PLgsS3FfcrtXgCJ10T+bFZIhZzkDs4Yg35E2IONKsKa/1ttZPYl9z+4ZIT7WN+Xlu6b8 0cD+hFUrKfehLNM5T4DQ3YDmPGJxK2x76Sggbpw8EBTDVAqObG6SiZcWWXITLlZmp73+ /bbA== 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 f4si2057875ejt.278.2020.10.16.09.13.29; Fri, 16 Oct 2020 09:13:53 -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 S2409778AbgJPPFy (ORCPT + 99 others); Fri, 16 Oct 2020 11:05:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:55946 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409774AbgJPPFx (ORCPT ); Fri, 16 Oct 2020 11:05:53 -0400 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 E21BBADA2; Fri, 16 Oct 2020 15:05:52 +0000 (UTC) Subject: Re: [PATCH] mm/compaction: Remove some useless code in compact_zone() To: David Hildenbrand , yanfei.xu@windriver.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20201014072349.34494-1-yanfei.xu@windriver.com> From: Vlastimil Babka Message-ID: Date: Fri, 16 Oct 2020 17:05:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/14/20 2:28 PM, David Hildenbrand wrote: > On 14.10.20 09:23, yanfei.xu@windriver.com wrote: >> From: Yanfei Xu >> >> start_pfn has been declared at the begin of compact_zone(), it's >> no need to declare it again. And remove an useless semicolon. >> >> Signed-off-by: Yanfei Xu >> --- >> mm/compaction.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/mm/compaction.c b/mm/compaction.c >> index 176dcded298e..5e69c1f94d96 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -2272,7 +2272,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) >> >> while ((ret = compact_finished(cc)) == COMPACT_CONTINUE) { >> int err; >> - unsigned long start_pfn = cc->migrate_pfn; >> + start_pfn = cc->migrate_pfn; > > There is a user in > > trace_mm_compaction_end(start_pfn, cc->migrate_pfn, cc->free_pfn, > end_pfn, sync, ret); > > we would now trace a different value, no? Agreed. We should rather rename the while-local one to avoid confusion. Something like "iteration_start_pfn" ? >> >> /* >> * Avoid multiple rescans which can happen if a page cannot be >> @@ -2309,7 +2309,6 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) >> case ISOLATE_SUCCESS: >> update_cached = false; >> last_migrated_pfn = start_pfn; >> - ; > > Huh, how does something like that happen :) Looks like "case ISOLATE_SUCCESS:" used to be an empty implementation, then statements got added, but semicolon not removed.