Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4996535ybh; Tue, 6 Aug 2019 22:29:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1v3bY57LHRtL00GJK8eyrS9mmtxZHaJq85E1YjP8VOkHG9ez7gU6+A0EzpEHXut0jI2QW X-Received: by 2002:a65:448a:: with SMTP id l10mr6057782pgq.327.1565155798926; Tue, 06 Aug 2019 22:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565155798; cv=none; d=google.com; s=arc-20160816; b=NaaRqdHpsy6x9HrWJm938fNPSNHhk+RIOw6r1fD2/AwNHWq/mD9u9cCV+uAdN2Ncwk N1f4AOk/+CcSZPk62BkC0GogKs/cVGxJqGQgiNGAUFz/+36cBfXG2J33SDMYC/Iz3nQJ Di+ryI6KzCji3EP/5Tdz1fWNQwn2MEMnLn9Mxmu0MPwhs/BQWoHQXRYA/1k1Sb59VrV8 ghNYIB2lF1mepU3xHicdXf+tlb4KGVNqndLSp+4HQv6NeRptVFZ59tEjmgi0kgBQB4fB AJG8lINCmf3Qb2RmGOIUrnIIPgKXyXcBOyxcKkM5BDeiIg8f4+L7P/pfjFcn2VtK4Vs/ hsSg== 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:dkim-signature; bh=1vTjKKjPXcwvezFpuQlHk79++RRKGCelf1VGueOrrEQ=; b=grIg/xqruIReNH8WtnZOKTS3CsTSwlDMltLfs62ZQGJH88khH8Rl5nOADQLlDXxewb whiigG5hHHn6/+wDCHsdJiCTvjDQ/LnRgWBM2kL9jIRY6tVol89pxnXfIyiCCtA0+1Em Y+gc3jpABn7TB8G8jOONC0SngCYiI3d6yP2WGMEeN+cfbu62LKvrzyzWFD25lESw4HlP ItJQ1e6i3vJ0muVKk0QtxVYraJZtNGB3G6Ll0I1nPGHcGxa4JMSRi3hFVK6qUhVhpgKF bm1XsvR8vwngqOydFNLeWWzbYodXJqiUVPt+os6ilgaJYXqOCmQFZs5zmWy8anhlxyTd 1yTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nCFuvFNj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j191si49664191pgd.88.2019.08.06.22.29.43; Tue, 06 Aug 2019 22:29:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nCFuvFNj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726258AbfHGF3K (ORCPT + 99 others); Wed, 7 Aug 2019 01:29:10 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37724 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbfHGF3K (ORCPT ); Wed, 7 Aug 2019 01:29:10 -0400 Received: by mail-pl1-f193.google.com with SMTP id b3so38930942plr.4 for ; Tue, 06 Aug 2019 22:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1vTjKKjPXcwvezFpuQlHk79++RRKGCelf1VGueOrrEQ=; b=nCFuvFNjI+cgrH3oDF1fIJi/Gq7hJFsokBsK8Uk0siw2EVuKNJSVN0AMOq6AEhD4Dx E6gEWGICMUy//3HQJjqquj7/B4tN4HRsxaKuilwqEnslFkay5kXcE4m4Z+7pnIfDNX4z J2MmaMZx/wIlbGaJqxZafWOrIgP0h2OmTm+nFq+KC5BQjgYoFj4YY61UuWYfPrzIK1NE OeM5sPFCAxPN4PUucNSQx0XuJcGZW5qJ7jDu+Ylt3wKlLwGa3tGfCcU6uunEtQEA6FsO GrtjjJOB+u2Fqwe4751ta6gDwDK1jAz6djR9iimXtoy14zH+CavZcZL7RtJ9tlZ9aCbF f4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1vTjKKjPXcwvezFpuQlHk79++RRKGCelf1VGueOrrEQ=; b=lHzlayfFxfjXjrBGu0VF1XeNmPtn77BFFBuZODudJNxkefBWNL+Awgr1IAhWk1ZxgW p4Fmlz13+lbLeRuFJ8ZnQ2Eteki/H0cAFYBSQL+XvfOecqa9lgGCC+BfNgPbjTxKx1TP 30j3DimUo2WE+HNfaKsqHKaClckPcwAwxib+XvtWZs4IWmK9GNxTFLC/LF9XpfWAeHd6 3AT6npENfEy5V31B0uz+ZwxePHtHkJ+a0/k5osGPnI+b2k0ITDZHeW7bVq3aE3UOhv/k JiDWC3KfENH93ktAEstAMcyz1iKi8biHPsEKG0zcXYkQqCpHsaRAeZtwCgTEvlmpI975 1AlQ== X-Gm-Message-State: APjAAAUWq9CWI9LcPlGQX+wJIc5A3EtNzQgvQi9edbO1ngQZ2eqnWYyS mujbRxQ6jUqeXyxSPfNOHQ== X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr6810509pjb.42.1565155748748; Tue, 06 Aug 2019 22:29:08 -0700 (PDT) Received: from mypc ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id v63sm91853525pfv.174.2019.08.06.22.29.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 22:29:08 -0700 (PDT) Date: Wed, 7 Aug 2019 13:28:58 +0800 From: Pingfan Liu To: Matthew Wilcox Cc: linux-mm@kvack.org, =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , Mel Gorman , Jan Kara , "Kirill A. Shutemov" , Michal Hocko , Mike Kravetz , Andrea Arcangeli , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mm/migrate: clean up useless code in migrate_vma_collect_pmd() Message-ID: <20190807052858.GA9749@mypc> References: <1565078411-27082-1-git-send-email-kernelfans@gmail.com> <20190806133503.GC30179@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190806133503.GC30179@bombadil.infradead.org> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 06, 2019 at 06:35:03AM -0700, Matthew Wilcox wrote: > > This needs something beyond the subject line. Maybe ... > > After these assignments, we either restart the loop with a fresh variable, > or we assign to the variable again without using the value we've assigned. > > Reviewed-by: Matthew Wilcox (Oracle) > > > goto next; > > } > > - pfn = page_to_pfn(page); > > After you've done all this, as far as I can tell, the 'pfn' variable is > only used in one arm of the conditions, so it can be moved there. > > ie something like: > > - unsigned long mpfn, pfn; > + unsigned long mpfn; > ... > - pfn = pte_pfn(pte); > ... > + unsigned long pfn = pte_pfn(pte); > + > This makes code better. Thank you for the suggestion. Will send v2 for this patch. Regards, Pingfan