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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 5E9E7C10DCE for ; Fri, 13 Mar 2020 00:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25FE920637 for ; Fri, 13 Mar 2020 00:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584059511; bh=U6yu3h1JK3KYJor/2fq9U7mcNdls4bBnMQ63AohUn3s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=qYtVIeZx8y+gCtKmz1xRpbnOIxUA9ICY+J/OUVJQjAsHufwDnHeA/RD0wzRG5RNTt xq4F8KmT+pqNj38QfcKK7GrqY8fAz81lGaQ/DpF03uUeuu30vcRuuPonqR8JuM0aRO c4LiUD+3twiGWmMXofqk7rYWMs2HiZleREXCAdPg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbgCMAbu (ORCPT ); Thu, 12 Mar 2020 20:31:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:56970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbgCMAbu (ORCPT ); Thu, 12 Mar 2020 20:31:50 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F9E6205F4; Fri, 13 Mar 2020 00:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584059509; bh=U6yu3h1JK3KYJor/2fq9U7mcNdls4bBnMQ63AohUn3s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=k0hfjg76kLJmC1o/ed6y+DKXm+1hSq9XjHy56gkrPxIn1xmxjuNe6vjBVy5dF6Jzy 3JWhHOXmBXxL+uAHm+kAtb0I8xUJgj7kFd1q4VpC8sgTYXdjA55Xf56X+iT+3/lHU5 On1nYG8MSqt41J1nrnU4vHCSkaCmrROEUWrISTdo= Date: Thu, 12 Mar 2020 17:31:48 -0700 From: Andrew Morton To: Stephen Rothwell Cc: Linux Next Mailing List , Linux Kernel Mailing List , Claudio Imbrenda Subject: Re: linux-next: build warning after merge of the akpm-current tree Message-Id: <20200312173148.6647751b1ad538687563f652@linux-foundation.org> In-Reply-To: <20200312182725.618ca518@canb.auug.org.au> References: <20200312182725.618ca518@canb.auug.org.au> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Thu, 12 Mar 2020 18:27:25 +1100 Stephen Rothwell wrote: > Hi all, > > After merging the akpm-current tree, today's linux-next build (arm > multi_v7_defconfig) produced this warning: > > mm/gup.c:119:13: warning: 'put_compound_head' defined but not used [-Wunused-function] > 119 | static void put_compound_head(struct page *page, int refs, unsigned int flags) > | ^~~~~~~~~~~~~~~~~ > > Introduced by commit > > 6379e529ebe4 ("mm/gup: fixup for 9947ea2c1e608e32 "mm/gup: track FOLL_PIN pages"") > Thanks. I think this is right. And I don't think it'll apply to most recent -next. --- a/mm/gup.c~mm-gup-track-foll_pin-pages-fix-2-fix +++ a/mm/gup.c @@ -78,21 +78,6 @@ static __maybe_unused struct page *try_g return NULL; } -static void put_compound_head(struct page *page, int refs, unsigned int flags) -{ - if (flags & FOLL_PIN) - refs *= GUP_PIN_COUNTING_BIAS; - - VM_BUG_ON_PAGE(page_ref_count(page) < refs, page); - /* - * Calling put_page() for each ref is unnecessarily slow. Only the last - * ref needs a put_page(). - */ - if (refs > 1) - page_ref_sub(page, refs - 1); - put_page(page); -} - /** * try_grab_page() - elevate a page's refcount by a flag-dependent amount * @@ -1967,7 +1952,24 @@ EXPORT_SYMBOL(get_user_pages_unlocked); * This code is based heavily on the PowerPC implementation by Nick Piggin. */ #ifdef CONFIG_HAVE_FAST_GUP + +static void put_compound_head(struct page *page, int refs, unsigned int flags) +{ + if (flags & FOLL_PIN) + refs *= GUP_PIN_COUNTING_BIAS; + + VM_BUG_ON_PAGE(page_ref_count(page) < refs, page); + /* + * Calling put_page() for each ref is unnecessarily slow. Only the last + * ref needs a put_page(). + */ + if (refs > 1) + page_ref_sub(page, refs - 1); + put_page(page); +} + #ifdef CONFIG_GUP_GET_PTE_LOW_HIGH + /* * WARNING: only to be used in the get_user_pages_fast() implementation. * _