From patchwork Fri Jul 6 13:09:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141317 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3097375ljj; Fri, 6 Jul 2018 06:09:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnZyYkM2t4eU51eqm3RytJIG34rEYdVB+AeQ3oC6Lsz6XPTBnRA/8d/svHp5fQuk42k4JQ X-Received: by 2002:a17:902:b7c5:: with SMTP id v5-v6mr10408155plz.30.1530882575711; Fri, 06 Jul 2018 06:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530882575; cv=none; d=google.com; s=arc-20160816; b=Z1pxZIeP9KpICcQ3/gomPckRkz8Im4iZuY1SIW5hfrJ+4xICdY+XvI48TunqKSBT1Y WLrc2xtjsfvi8zG3Nq/Eqy8D4009FjLnVisPX//PLdO18JEWvWvuM7jtGyj58zVHrfYb bV5iY+BS62xaHJYWV8iZgMFrAGdzVAeW14U7a7IswVr25OluiHboTkhdppj5onAj9s80 5q3Hwj+wd0bXJseN1kWRZDDGUb15zJ/0EZoWha7OLnkX2PYAW/s08QfGNYpy6YNs+icO zRbCiXFzpyaUrYmLDVNmimGlp6/oMRIDH83VKSAMwJMIQimdXIQ4yvk82O110c9qB4YD AgAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=R42c6JG1WV61BdC0IP8ZA8fTJSOWJHwvy+DBz87WSh0=; b=Hpm8nMRAGHGEw7N+MOfIei5yZSHDA3KEBkGPf8BKwNQGkAehUgRKoE7oz9kutO+9ez s2fohqyWeGPqS4PdKgl+vb/3cCNomEtyQQUGrb73plfUsdPVKuUvbzvnjiClw0wkqrxj NJocqKj4EdWpILDWjlynICuBchSLSnZ9mnKGmh5Sjvr1ry7plUrzuXG+roF/rj7WHrv5 p9FUYl/XER3JyWJj4RQKJMqM4ivJb0GhVclTszQNwrmWBVMRT1J1E1JBzXTdfaSVseTD 51qgpUfLZ6U821wrVXncLuae0Uxjc4DrbgMT/J7xqqkt3IRIiCAGgTQLskvX9HY2BgSt hlYw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10-v6si7492585pgt.552.2018.07.06.06.09.35; Fri, 06 Jul 2018 06:09:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933255AbeGFNJd (ORCPT + 30 others); Fri, 6 Jul 2018 09:09:33 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:42644 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932870AbeGFNJc (ORCPT ); Fri, 6 Jul 2018 09:09:32 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0MJ1cT-1fYwaC3RBB-002Vc6; Fri, 06 Jul 2018 15:09:25 +0200 From: Arnd Bergmann To: Minchan Kim , Nitin Gupta Cc: Colin Ian King , Arnd Bergmann , Sergey Senozhatsky , Andrew Morton , Nick Desaulniers , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] zmalloc: hide unused lock_zspage Date: Fri, 6 Jul 2018 15:09:02 +0200 Message-Id: <20180706130924.3891230-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:4rEuEmSRwf5ryB+wBQ2gAsXvBAbhGKDH4WcZZHTZu5qqdCEXDsK UDI5CzboLBEMD904U1LHLlejQrJyCBSnZiM+XL19dMgKvP5Q9rza2P/WzeW9IgIAeRbkuUL 0aLyJfo61YtBydtLx7Yn7FM26ksfSgi0AKo31FvjUuFr0SU1YHikCpqN+UXfMKX+qkFCOig oENc3AyLG5UCpmCKmdjjw== X-UI-Out-Filterresults: notjunk:1; V01:K0:7xXpi0wxGcU=:GTTFDHwA1JHsxfMzg3aNes btgkd+i6TGgmFlpgdXxbUNZvhWFt7v/yhjZPgWx6J5Qc7V0qbENeP4sgtKpUA6hAO7l+skNdL SLZa8tMn92besZhHynkx0P2Q/upkyT+VAP1MWAnFb//3Z984z77rGk7XDW1XOYIU/sQvY9Agu Y8CguazeyXAyS9W7YRbOThekbbvNi8RMMnb3/cYh9fzNsNkC6b4ATcHWsNScNHFoyo4X1Jrzd TDlVlrSz/4CxxQiLNiDaHIwlypRCkICgTHMsrMS6S+TxG1eNUKvNcMyj092hJSzcGZqELJqg/ zdN4xPCrl6U9Hbke8lyvTMKGIOqSnqeTxKjkD9AdLsld26GNU1OOir4W2OSSP02Ca9BQyKXnq BilrXnBRARDFrPzYaaOyDm6TODlSza0t+IBP22Ft8Kf/j8MhdKDERKSuw3BwjTp5DsbqDvRhw NBRnHQarnYZiXUqNi4drb2rCzGcjopAVFxnTP/aUDxXIzaiFV/k2JgOz85IU8hRC2bR8XS76X v5SPzWAmkimvgKgi6bAjVSPxAJoEPV4fmvsojKx6r9HdtwFBmH0RweNpej1/uBxjk0tgGhfph hIQ03otqA7rf6+K2ybY/E1iXK5v4EtJol+sv7x2FQxbK2FfQu/nxjN/Area4vcMCKWDr5jdqH DJBEMxD+WQXeLi4AmGE17T0mECyI/kSCpv/Pw+fDMhO76lHFcJeo4VWKrNBK+x+hnCpo= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Making lock_zspage() static revealed that it is unused in some confiurations: mm/zsmalloc.c:931:13: error: 'lock_zspage' defined but not used [-Werror=unused-function] I considered moving it into the same #ifdef that hides its user, but it seems better to keep it close to trylock_zspage() etc, so this marks it __maybe_unused() to let the compiler drop it without warning about it. Fixes: 0de664ada6b6 ("mm/zsmalloc.c: make several functions and a struct static") Signed-off-by: Arnd Bergmann --- mm/zsmalloc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.9.0 diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 900bea99452a..58886d40786b 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -924,19 +924,6 @@ static void reset_page(struct page *page) page->freelist = NULL; } -/* - * To prevent zspage destroy during migration, zspage freeing should - * hold locks of all pages in the zspage. - */ -static void lock_zspage(struct zspage *zspage) -{ - struct page *page = get_first_page(zspage); - - do { - lock_page(page); - } while ((page = get_next_page(page)) != NULL); -} - static int trylock_zspage(struct zspage *zspage) { struct page *cursor, *fail; @@ -1814,6 +1801,19 @@ static enum fullness_group putback_zspage(struct size_class *class, } #ifdef CONFIG_COMPACTION +/* + * To prevent zspage destroy during migration, zspage freeing should + * hold locks of all pages in the zspage. + */ +static void lock_zspage(struct zspage *zspage) +{ + struct page *page = get_first_page(zspage); + + do { + lock_page(page); + } while ((page = get_next_page(page)) != NULL); +} + static struct dentry *zs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, size_t data_size)