From patchwork Mon Feb 20 13:22:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13146449 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 6227CC05027 for ; Mon, 20 Feb 2023 13:23:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EDC2F6B0098; Mon, 20 Feb 2023 08:23:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E8BBC6B0099; Mon, 20 Feb 2023 08:23:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D54826B009A; Mon, 20 Feb 2023 08:23:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C59256B0098 for ; Mon, 20 Feb 2023 08:23:33 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A3EC3806CD for ; Mon, 20 Feb 2023 13:23:33 +0000 (UTC) X-FDA: 80487737106.23.BA4FD6E Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf01.hostedemail.com (Postfix) with ESMTP id D297640010 for ; Mon, 20 Feb 2023 13:23:31 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=nMwt1Pdv; spf=pass (imf01.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676899411; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7a03/P6hFidoitBllB4mK3vwdRJStJLOrtRldGH4AfI=; b=s4b5LqfbrG9nPVac0ENaacJ7hghNs2eVBK6XNqKMR8rfXeh1ssnz4WtQdYptsxv8AKy8NU QXV/vdgk7qlmFvgXt+wbQvMltvpBV4Flk0ZBF4ywRUX8pzlBJ5Baq1qYfGGpVLdhRBFlsu eN3ljwYdm2VHf/Rk60+IgBhAkqDnDzg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=nMwt1Pdv; spf=pass (imf01.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676899411; a=rsa-sha256; cv=none; b=gdRf6CBHFOamzaC1e50Mr6Vj3dZX0LGgyGHga4M/UQc6wJSetTBq+DHRoxKpatSZ+UHsd8 UiskYCxr7N+cK1WyoLOSFN1BZyeNGZwW9ELEsG85I8XQCS5xKYWwYtrWRPG6Sn0Oze77f+ OjulU5pjaIqslGLy9EqNl+DzY0M6ELI= Received: by mail-pl1-f179.google.com with SMTP id q11so1666952plx.5 for ; Mon, 20 Feb 2023 05:23:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7a03/P6hFidoitBllB4mK3vwdRJStJLOrtRldGH4AfI=; b=nMwt1PdvsteeTmoduP/xdo2UXS/AsFsCRaRgWMDKXOhN356Lv+sBKSXR+gTfJrbVd6 bHG30sP/BWKeCkj9vWaIO+rRraygiOie79pbS3sWdmnkokPvTFujcYJMyZNYYbSPhQu9 MMULwGB4IKMILVtFCNsnwiyHGyuq9Pevivqj5FJA3km4YLmASYBm65JQJv9zNBlxss0S HQEPjfcoNi3YlA7oUUEuPw/NxOZA3Y0cKW+C0nl+EFCQKHC3X9MJ2L8QJh154TDrP9HT xOiZ4byPiAwtVdBvhtNK1jBE2RUBqZtGHXxu2AbYq9L9UllPQNhtlSkRQq3Ucmco2B1q Ioyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7a03/P6hFidoitBllB4mK3vwdRJStJLOrtRldGH4AfI=; b=3jpTMP9e4ag97m9jmpVoTrS1cb/4glPXAlY1j0174KJfJBzwpUAtvBRtMOEU3oHIJr vztta/oZpBVlloQjZ3BZ3n9CocZ77P9F7ZLznJ1tiyE2FSr4QNvG9JvjuRAelGnDNJG3 Q1XgQf5Gt48fKErt6Kmrkq1HGMn2tzOLmi90D+xJXsHwtal+UU8SrQhW1mJWeQ4RG1QU i1buKFtalQK7AxoLHGaz4fHvIgcTFcQd2hcmg5SLagOxFy9fnQ7HroK9yLohUxFY+2FW kjqD3NfN7MguLu68GtJMZtycasSRFb16qul0qLp04gBMk2BwZ9CHPHAPTEX5p73UW5xz oCmA== X-Gm-Message-State: AO0yUKVdO2/cf6jh+x+Q8PdiRrSMtkbyjuuDaWpII9tnif8nOF0eIVvx 5lYNVCbqfuBqIeoNn+klqko= X-Google-Smtp-Source: AK7set8tna5Ng7CyA9kkxw1OklqZY/6FKqijDKIBleOtBlRPG+naHYjUQ9INk/YGDG2q+oGDDZjOwg== X-Received: by 2002:a17:903:189:b0:19a:a815:285e with SMTP id z9-20020a170903018900b0019aa815285emr4138665plg.62.1676899410777; Mon, 20 Feb 2023 05:23:30 -0800 (PST) Received: from test-ha.kr-central-1.c.kakaoi.io ([210.109.63.229]) by smtp.gmail.com with ESMTPSA id x2-20020a170902fe8200b0019c13d032d8sm6125436plm.253.2023.02.20.05.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 05:23:30 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky , Matthew Wilcox Cc: Andrew Morton , linux-mm@kvack.org, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH 21/25] mm/zsmalloc: convert SetZsPageMovable() to use zsdesc Date: Mon, 20 Feb 2023 13:22:14 +0000 Message-Id: <20230220132218.546369-22-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230220132218.546369-1-42.hyeyoo@gmail.com> References: <20230220132218.546369-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: D297640010 X-Stat-Signature: m98jswkoa5ku5hxcsqogtn8a1n396e8a X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1676899411-487123 X-HE-Meta: U2FsdGVkX18gpgvN+bkJvmkjec892SOXYuWjcmLbBIPuYcR/lKq+acgBIwynBjAGLyWJCzZ68pnbFkvLt64KZ/mh/QfONmiudy/j7XhTXSrXecRqg9oNqMJPgRCrxJp3W5ggBIFB7alZH4SrUpR3L2IwBKgGUm6cOwmzJqEzmmTyRMGHGo6klmALt67MmROTBVeRMZ8B3DoBfZPx3rLvcDa1FrgOMW2q0X9N1QmX6ogM0FAu8ShztJU7e/xjYWu7BXetRLeEKc37aDfkj6Wp1cfGJuNsXwt/97W8+aS2M81sNL8vldQQWBGCRWwjZKP+O1ywt9Pg9RClHHe94ccNsEJbK05Eet3z92MRjh6RtNgf7QnNSxUYYtSfkrUxtDdX91N4ktbvxHMj/DLzDSvKrd77DsnaubGo922tIUJ9fkCdKfcHKXbBw9YW+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rk+UKxkaxo8VT+etQC5+TT9xv6JacbuM+cR6xDuE37g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000009, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Convert SetZsPageMovable() to use zsdesc. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/zsmalloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 5af0fee6e3ed..e9202bb14704 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2357,13 +2357,13 @@ static void init_deferred_free(struct zs_pool *pool) static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage) { - struct page *page = get_first_page(zspage); + struct zsdesc *zsdesc = get_first_zsdesc(zspage); do { - WARN_ON(!trylock_page(page)); - __SetPageMovable(page, &zsmalloc_mops); - unlock_page(page); - } while ((page = get_next_page(page)) != NULL); + WARN_ON(!trylock_zsdesc(zsdesc)); + zsdesc_set_movable(zsdesc); + unlock_zsdesc(zsdesc); + } while ((zsdesc = get_next_zsdesc(zsdesc)) != NULL); } #else static inline void zs_flush_migration(struct zs_pool *pool) { }