Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3133489lqt; Tue, 23 Apr 2024 11:10:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbm/9GPZM4YkBahCMuD3wbh3ruMzVT5PRcK1DWzWKKkT7j/XF1kvnJFExGZt3+gN4lT1diCvMtFLr2j+lQOHxUGsZJpfB5/ocER+PU1A== X-Google-Smtp-Source: AGHT+IGwMXp5z9E+7NZI1NOrysIELshXyOqr45wq3kNl3Ezynib2ndyS9M658fR+o5s1rq3QNnz5 X-Received: by 2002:a05:620a:22c2:b0:790:7345:2791 with SMTP id o2-20020a05620a22c200b0079073452791mr228030qki.56.1713895807828; Tue, 23 Apr 2024 11:10:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713895807; cv=pass; d=google.com; s=arc-20160816; b=wUKqZf9usJSSotahT4wKIpsZEc/XWq4H4m22uLSHG5WjW6gjsT+zdgRwLQaQfYJ0Dv jwiwPaVOhgnM0xIIS0VyYF0PhZhJIlZRt1NHtPF9CVlED/SfMkdV6RO+JnxXxiF8nWxj 2Pk+D9Owm3326XA7nJmnS1Z7Gv+p2cZtStdKNP/ltl92zXzG0hbstrUE5/C4Mn2yPk4T ziYj5c/IPfD/uoFRyA4oGEKx8gUSZJiObDPgjED17YVSKfPJTYl1MTe6KpLNYcDb0zJw Ed3Iwl04rMJd8bEIqXowtK89nCbozSa1U7e/4+Mc4h86+q7itFpke5q0ZjuT4+wEuOMB UPiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=dGsm+ggZOlHU5FtufmukiaBNtRIWnNG+uUCPTczYIiY=; fh=e1fQNTlzCCX3oMg1zBtYLrCHSJQQ0TeObFlWmMMXbiQ=; b=Wt8hbnldUhpVo1y5QWuo3C5vv80Fppyjvt2J28ODjOreu2aXXHuhdsf/UA514+hZHq pRWGGOvowtFSMdnzGwIZSoB9Su0VyqqU2AHvF+KIMjz9fOVZgHouKERaErh7BlHaIm6m /8jGBPq2IqON/TBFqRzcDdUKQ8d63dChjA463XKCyEEJpg8XtAFuL6nHBMPaJYthi+XD l2LMZGAofLLUlcFx1x2rhRq7vnCfTezns3W7bfvyXm4WcDlGZL+t65bl6a7hMPa88Qj1 Ur3mvcBHWJIfUMqvm3b533HgJqbIRWWqvWKHCEimJdsnMb3nNXun2mBcX1cFniJv4h3S 29bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="o2/ujoUL"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-155733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155733-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y21-20020a05620a0e1500b0078d63e1dee0si13129738qkm.215.2024.04.23.11.10.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 11:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="o2/ujoUL"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-155733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155733-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8A34C1C220C8 for ; Tue, 23 Apr 2024 18:10:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E54C13E3EB; Tue, 23 Apr 2024 18:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="o2/ujoUL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EF4A13666F for ; Tue, 23 Apr 2024 18:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713895802; cv=none; b=nsMKlcAnc3FeZPbC5gYfkF1Na8B0yyPbhPiMOq2Lz48dWtmUKN3sxD7hVBTJKjfo2Irr0sXiaj6VJIHR3uGNHzKMg1mDlMSDs6UCjOW0lz6n+ZMGEnvZ9cLVDeF6wxbJKzZJh/CJ3H3/W72qQGQxgybWS3OgL9z8aAbK0bF1gbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713895802; c=relaxed/simple; bh=yWwuu1e4Hy/gDnhnwnLfWKeZpMIKvT0w/k6BBM66aAA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=WXu43AJkCvvuNC0UmwUPUSyoUYsKwUiKmx89G9A1oKt0wnlBb0hKq1EVAEni+MUAY0gIwS6mEMotpkEROOxT1npLXcKIJntHkKtweww/L8xyp/hs+thlXiMKNNn/rLrpDU5NkDi4SrGi3OHk0QzJodIoSzEX/JfcbRGVwHes4Sk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=o2/ujoUL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7736BC116B1; Tue, 23 Apr 2024 18:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1713895801; bh=yWwuu1e4Hy/gDnhnwnLfWKeZpMIKvT0w/k6BBM66aAA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o2/ujoULwF6bOMvmsYyRuy1cgJOOfvjqUuYr3RWSGnano4cCpwN1hDcCa7/8PlzFp mnzXeuxkZ9NYm1X5bPcSsytb8gt6l5iNzWmyQs7I7kJxwApRcSAsm70/ejO+d0PbVz IljyuzZNxH1bz9VB3gcotsfAmMtsR36StvR2Sc2U= Date: Tue, 23 Apr 2024 11:10:00 -0700 From: Andrew Morton To: Andy Shevchenko Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Rasmus Villemoes , Johannes Weiner Subject: Re: [PATCH v2 1/1] mm: page_alloc: Avoid defining unused function Message-Id: <20240423111000.aaf74252a07d7e7fd56d7e12@linux-foundation.org> In-Reply-To: <20240423161506.2637177-1-andriy.shevchenko@linux.intel.com> References: <20240423161506.2637177-1-andriy.shevchenko@linux.intel.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 23 Apr 2024 19:14:43 +0300 Andy Shevchenko wrote: > In some configurations I got > mm/page_alloc.c:656:20: warning: unused function 'add_to_free_list' [-Wunused-function] > Becuase the only user is guarged with a certain ifdeffery, > do the same for add_to_free_list(). > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -653,14 +653,6 @@ static inline void __add_to_free_list(struct page *page, struct zone *zone, > area->nr_free++; > } > > -static inline void add_to_free_list(struct page *page, struct zone *zone, > - unsigned int order, int migratetype, > - bool tail) > -{ > - __add_to_free_list(page, zone, order, migratetype, tail); > - account_freepages(zone, 1 << order, migratetype); > -} > - > /* > * Used for pages which are on another list. Move the pages to the tail > * of the list - so the moved pages won't immediately be considered for > @@ -6776,6 +6768,14 @@ bool is_free_buddy_page(const struct page *page) > EXPORT_SYMBOL(is_free_buddy_page); > > #ifdef CONFIG_MEMORY_FAILURE > +static inline void add_to_free_list(struct page *page, struct zone *zone, > + unsigned int order, int migratetype, > + bool tail) > +{ > + __add_to_free_list(page, zone, order, migratetype, tail); > + account_freepages(zone, 1 << order, migratetype); > +} > + > /* > * Break down a higher-order page in sub-pages, and keep our target out of > * buddy allocator. Thanks, I'll queue this as a fix against "mm: page_alloc: consolidate free page accounting". Please do tell us the config when fixing these things. That way I can do a little bisect to ensure that I correctly identified the offending patch.