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: 10511699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83B32600CA for ; Fri, 6 Jul 2018 13:14:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7296F285E3 for ; Fri, 6 Jul 2018 13:14:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 645ED28671; Fri, 6 Jul 2018 13:14:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AF2F285E1 for ; Fri, 6 Jul 2018 13:14:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B2526B000A; Fri, 6 Jul 2018 09:14:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 061396B000C; Fri, 6 Jul 2018 09:14:39 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E92576B000D; Fri, 6 Jul 2018 09:14:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 8F82B6B000A for ; Fri, 6 Jul 2018 09:14:38 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id o1-v6so6939391wmc.6 for ; Fri, 06 Jul 2018 06:14:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=R42c6JG1WV61BdC0IP8ZA8fTJSOWJHwvy+DBz87WSh0=; b=GOh6LyWcxpqriwyNVnAPsC27TfaOusherW8otOwwjG9OQEzvWX3Abg4IHXQHXaG6v9 InEXLTBOAtMrPeF/NC51aA767iYZ0zDIWNuFYFVvgVqC0xzImNc5gmtN5WsQyynrXNSI c69SX4K/ZqB82zDKXPMxx6nJXgvonKrUfX/jk8q9N5kk7vgVCWKvzckVRLMDDDtKxw88 qP+5J7s54+gYPNR+ZX9WhlZLICri6VbOX+PLChn7RDcUqgMdK+BmzHmxkWWsTVLNzFu1 2xBS84XCmnVN4ewMXWivFI3VvYjB6vxkr9pdNq+C1/iT+8qAiwRAHaX1TXN0ipzvEA/A FIQQ== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.131 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mailfrom=arnd@arndb.de X-Gm-Message-State: APt69E0HdnomX9o5dF677KdhC7oLL/osw9sIDxAXUMX87AySOBXmN0rb Aj40g3PfNa+ZhZ9/KDpYtPww4PXSdTM64ealHptXM0MxsZdEI2QS/S0vU5vux+W1WHRWbK3VMFE mYuk9y+1B9qWy5Q+1pRD8mZKuSRvWea7tmoAb1kloolO+uRcdxuI+JKz25MgcEX8= X-Received: by 2002:adf:e3c5:: with SMTP id k5-v6mr7985290wrm.94.1530882878027; Fri, 06 Jul 2018 06:14:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcA/xhDOaEogj6iJ0FPYYndV2sEfwheP67wuE9JpJleG9Jj16Mf/hUv7bMS1HNHKNiC/whO X-Received: by 2002:adf:e3c5:: with SMTP id k5-v6mr7985251wrm.94.1530882877229; Fri, 06 Jul 2018 06:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530882877; cv=none; d=google.com; s=arc-20160816; b=eMwIEZtgBR0xGhQQEPn9FCEOMXcXfsMn/v+Pqe60ROGbT8YpA0ZTLPcK2Wj8luSNfO 65YrPQD5rRxYvhie1rXsb65IfR5cWFCOJaOR3oBxccDcdQnojHCAtBP+RuWtPMYib542 t/zAflFKPikSiKDfeLbdTkCeZzleZaeCf9ZXlB/Ay5n3RcFGWugsHn7n9ur6dyF98pCB qjfO21KIEgAXHgtdwOo3iuJx6srIDIF4mi+djiISnVpwnyJmeZmqKKcUrU/f1C/e7KSR hJxsLM+NNPBb4z0pIrB1Vz6g2/UKJbp1wgUcpKOVeAElncDm7oIgx7OvFKR82Rk4jgHj W76w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=R42c6JG1WV61BdC0IP8ZA8fTJSOWJHwvy+DBz87WSh0=; b=m+1BcOEDGOYqAKjX1fF1tFiQ2HFPw9AJOVSC5uNEEU7sy0UlEPuFszfNRJFqyDdljr zOwXpK9uQ0HKPHJph8P9i49ToqFub8r77icm1OJl6odHDvel3Z9ATwt42vvB4g6oVSTX PubLyTmL0ebq0nwpXzuxBZGvrZrxcuY3wHJIo9EnEexf46D/saJB/645ocFx79QmFXOF mKOeOgf7PRttJcWVzEvgzdyBczgPCSTs+0c7mcWa9UxycXmCkKgk7uMOwwsMyT0dBmvw gXZbRY/ckCkqjDi6dHtGWExYMAbLEATaMq112mA7xhSWpXa+sdIQ3lJCQQoK7w8NiA8K UFAA== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 212.227.126.131 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mailfrom=arnd@arndb.de Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.126.131]) by mx.google.com with ESMTPS id 52-v6si8100234wrb.354.2018.07.06.06.14.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 06:14:37 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.131 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.131 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mailfrom=arnd@arndb.de 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:bZTugxNkf6Y=:/dQY3dLm/1oXFg+dFKNqx8 CXz/R/QSkGWyJQH0pyhUzbkIt43mMi4EVTKkfiHntlEExyJ2bnSt2MG0klzZBKm46A+TvvMz/ j3DvlsF2KqBOKxFF0veMvNV4m8EfLY6g7/R7aYoOBHKkihGdgbTXlj+stJIF4IgDIr1eaUCxP BBLmiEa6HDVEGIwr6TaF1X2leyY2PNOFjTFAV8Di/b9+wBHzZ4Eut8h/h+vbijXirCcjZv5d7 qzdIWa4toCRgNYurgtRjSfkYU1ZzKs3YMsDg8DoSFSzrmLUbME//Y+WVH6rQl35iVY/41PCbS 2dKOlnyJDseFME1Bc/FvP++5Zj4f4u4/8VAXJ7DDEnhiUSYlb/yH3mfYMBl04kufKhRuO/QXN XEF+7RsnxSHQ2Afq4DwLGkMzNvb+gW+roD0Fd0ptsurejPOZzAg80QGz2GmCotgIzw3w5xXUf ori0NlJu8v0W2H9tyriX0AYmfbPXcBcwR/gBhq8lOipGvlEgfYhYwd5Do+tr9b1WWMV5yvg4M nNCswDqS9/PXvzEpJRnY3sB6IPOGaBP4sG267cnmKjwo54q3f7KAShUn/QsSipPK0/fIWdf4H X+xWzmc5GsaBq2zZiHinvKSFJ2D/1k2BuwzSBQt/ZSjAuc0WSCZi0tPpUG7maaE4rh/iv7hyv Ssd5zTBOriSdGVIBpjpQxwVCfolFWp1vd/oenzyanzx/dx19YvYZPkNcxpjQmi8BQ4XU= 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: X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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)