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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 EEEFEC43461 for ; Thu, 17 Sep 2020 11:48:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A747208DB for ; Thu, 17 Sep 2020 11:48:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="a7wdR9mY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A747208DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E0C596B0037; Thu, 17 Sep 2020 07:48:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DBD306B0055; Thu, 17 Sep 2020 07:48:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD2B46B005A; Thu, 17 Sep 2020 07:48:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id B6D856B0037 for ; Thu, 17 Sep 2020 07:48:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 83A203632 for ; Thu, 17 Sep 2020 11:48:35 +0000 (UTC) X-FDA: 77272380990.25.cast68_5f0d56a27122 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 4C9A31804E51C for ; Thu, 17 Sep 2020 11:48:35 +0000 (UTC) X-HE-Tag: cast68_5f0d56a27122 X-Filterd-Recvd-Size: 1852 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 11:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XWAGowxIglaD0BztvJoBf9d1lchkWHz/K6xKkfOqrw0=; b=a7wdR9mYS/f77fa4W1AsaXvV2X k9TVyVxV9+R9Va1cDnPoPostxa3LlQNK4RCJpYAc3F/xvzDGuwfG5lPCpQeEpd27BdMqnIZRywkBm iNs1vcupRCdfMJEMh+gGGJ14gxP/U3lCTZWxGaSDAC4OT9JXH39qkaq85iOQ5ffIk/yhTYPEgedJZ uGLMIdtI0n7Sb2TAGzvF1BEZbfjcv7JhqOJmeNjPulkAy/54IIr95BrvI69CJBjjZp8iuJMyGkW93 I/UakmKVQv/EkQq9AWrW6nQuq7TAMkIucLG9aqSFOx/Hz+zf0lWUslNGO71+IytshGO6dr29AzMpS lP9ot2+A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIsOm-0005JM-E5; Thu, 17 Sep 2020 11:48:24 +0000 Date: Thu, 17 Sep 2020 12:48:24 +0100 From: Matthew Wilcox To: Miaohe Lin Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: avoid possible multiple call to swap_node() Message-ID: <20200917114824.GS5449@casper.infradead.org> References: <20200917114449.35285-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200917114449.35285-1-linmiaohe@huawei.com> X-Rspamd-Queue-Id: 4C9A31804E51C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Thu, Sep 17, 2020 at 07:44:49AM -0400, Miaohe Lin wrote: > Cache the swap_node() in a local variable to avoid possible multiple call > to swap_node(), though compiler may do this for us. Why don't you find out? Compare the assembly before and after, see what the compiler did.