From patchwork Sat Feb 19 09:25:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12752175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B555FC433FE for ; Sat, 19 Feb 2022 09:26:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 953216B0081; Sat, 19 Feb 2022 04:26:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 904256B0083; Sat, 19 Feb 2022 04:26:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 587776B0087; Sat, 19 Feb 2022 04:26:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 3C6C26B0081 for ; Sat, 19 Feb 2022 04:26:27 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E65A2181953E5 for ; Sat, 19 Feb 2022 09:26:26 +0000 (UTC) X-FDA: 79158998772.31.F5F8928 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf02.hostedemail.com (Postfix) with ESMTP id 42A8980010 for ; Sat, 19 Feb 2022 09:26:26 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4K133m30jLzbbb9; Sat, 19 Feb 2022 17:21:56 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 19 Feb 2022 17:26:21 +0800 From: Miaohe Lin To: CC: , , , Subject: [PATCH 7/9] mm/z3fold: remove redundant list_del_init of zhdr->buddy in z3fold_free Date: Sat, 19 Feb 2022 17:25:31 +0800 Message-ID: <20220219092533.12596-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220219092533.12596-1-linmiaohe@huawei.com> References: <20220219092533.12596-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 42A8980010 X-Stat-Signature: qji3ckdb84zmr8fzspesimcmxo1snz87 X-HE-Tag: 1645262786-570661 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: The do_compact_page will do list_del_init(&zhdr->buddy) for us. Remove this extra one to save some possible cpu cycles. Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool --- mm/z3fold.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 18a697f6fe32..867c590df027 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -1244,9 +1244,6 @@ static void z3fold_free(struct z3fold_pool *pool, unsigned long handle) return; } if (zhdr->cpu < 0 || !cpu_online(zhdr->cpu)) { - spin_lock(&pool->lock); - list_del_init(&zhdr->buddy); - spin_unlock(&pool->lock); zhdr->cpu = -1; kref_get(&zhdr->refcount); clear_bit(PAGE_CLAIMED, &page->private);