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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 714F2C43462 for ; Tue, 11 May 2021 13:49:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ED1EB6191C for ; Tue, 11 May 2021 13:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED1EB6191C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 541DE6B006E; Tue, 11 May 2021 09:49:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 516118D0001; Tue, 11 May 2021 09:49:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 390556B0078; Tue, 11 May 2021 09:49:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id 1824B6B006E for ; Tue, 11 May 2021 09:49:17 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B760A824999B for ; Tue, 11 May 2021 13:49:16 +0000 (UTC) X-FDA: 78129081912.10.E8BB38B Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf30.hostedemail.com (Postfix) with ESMTP id BF221E0011F1 for ; Tue, 11 May 2021 13:48:46 +0000 (UTC) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FffN90WQSz1BLDj; Tue, 11 May 2021 21:46:33 +0800 (CST) Received: from huawei.com (10.175.104.170) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Tue, 11 May 2021 21:49:03 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH v3 2/5] mm/huge_memory.c: use page->deferred_list Date: Tue, 11 May 2021 21:48:54 +0800 Message-ID: <20210511134857.1581273-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210511134857.1581273-1-linmiaohe@huawei.com> References: <20210511134857.1581273-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.170] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: BF221E0011F1 Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=none) header.from=huawei.com X-Rspamd-Server: rspam03 X-Stat-Signature: wcfr6dc4ufw16oupopph99mdxjngqw6b Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1620740926-918516 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: Now that we can represent the location of ->deferred_list instead of ->mapping + ->index, make use of it to improve readability. Reviewed-by: Yang Shi Reviewed-by: David Hildenbrand Signed-off-by: Miaohe Lin --- mm/huge_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 63ed6b25deaa..76ca1eb2a223 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2868,7 +2868,7 @@ static unsigned long deferred_split_scan(struct shr= inker *shrink, spin_lock_irqsave(&ds_queue->split_queue_lock, flags); /* Take pin on all head pages to avoid freeing them under us */ list_for_each_safe(pos, next, &ds_queue->split_queue) { - page =3D list_entry((void *)pos, struct page, mapping); + page =3D list_entry((void *)pos, struct page, deferred_list); page =3D compound_head(page); if (get_page_unless_zero(page)) { list_move(page_deferred_list(page), &list); @@ -2883,7 +2883,7 @@ static unsigned long deferred_split_scan(struct shr= inker *shrink, spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags); =20 list_for_each_safe(pos, next, &list) { - page =3D list_entry((void *)pos, struct page, mapping); + page =3D list_entry((void *)pos, struct page, deferred_list); if (!trylock_page(page)) goto next; /* split_huge_page() removes page from list on success */ --=20 2.23.0