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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9851E77188 for ; Fri, 3 Jan 2025 14:13:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E6E46B007B; Fri, 3 Jan 2025 09:13:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1963C6B0082; Fri, 3 Jan 2025 09:13:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 036076B0083; Fri, 3 Jan 2025 09:13:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D89CC6B007B for ; Fri, 3 Jan 2025 09:13:09 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 356B412081C for ; Fri, 3 Jan 2025 14:13:09 +0000 (UTC) X-FDA: 82966331910.02.F6C1855 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 6F54F14000B for ; Fri, 3 Jan 2025 14:12:31 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DnT5ZHNm; spf=pass (imf09.hostedemail.com: domain of luizcap@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=luizcap@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735913538; a=rsa-sha256; cv=none; b=oUto23pkR4qGL5y1BzNLrw0PyKlIuwCUYKOZ6E+q0Zs546/NInwL/edRMQxj0Iav5vaqN9 C4vMJFq/jYCDrjTtxw1CNx3EzFjXnTeENMBLLt5T2CNNP+2Z7asPhB+8XkLmnVny14h3qy pmyWETgFbZIxh+WgHGZuDbO5TD8UVTQ= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DnT5ZHNm; spf=pass (imf09.hostedemail.com: domain of luizcap@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=luizcap@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735913538; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=q50EBBo/WOeLAs8/4dtu+U+Qr48eaJOvxqJ8fJgshjY=; b=Cd4s91yuj/Lv9dOZzOtmZ45dLp/VOo+3fT8ktsOBC+AGSiHNRZBMPGA0xIyZuAHIRzbUdE QTF4xqcN3HA0V++YnCu6KY5rFXMKZQ+0RByQFSQ7ZPF5VTLTkfVShGlJBvLCyzOAGOCEIv Z+3JYMLilVbPf1noWjROsSTCE7VDXCc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1735913586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q50EBBo/WOeLAs8/4dtu+U+Qr48eaJOvxqJ8fJgshjY=; b=DnT5ZHNmXmvjictjDA0ldE5zIaB8Imgd59G8nnlO+3GzGQCi1VorHnf/77v1LcryEkBimI CLw0TGgjdAnvB2AKGe2DnRyMsFi1OUB4jsilwHwV2n5NEaR48qdLllxiYvn15jj5AKgE9t bJhshBSd1+tHrKk1knuneaSp34YrVGI= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-214-O83lnclLPMO2Ujp9mKblCg-1; Fri, 03 Jan 2025 09:13:04 -0500 X-MC-Unique: O83lnclLPMO2Ujp9mKblCg-1 X-Mimecast-MFC-AGG-ID: O83lnclLPMO2Ujp9mKblCg Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6d8f14fc179so359318986d6.2 for ; Fri, 03 Jan 2025 06:13:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735913584; x=1736518384; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q50EBBo/WOeLAs8/4dtu+U+Qr48eaJOvxqJ8fJgshjY=; b=EfWmc2IL1bPMaiTWPGs13TwbxjGONkHXuUG+LFy5KOv9ttpEIjQjLAcPQAmKiMrSOA nHBXPmG+vi1JZTBqcJP5JVAkEahphCKLVwpxYBTeOW+gDU9yXn4Eb+jIoaxmjD96c0mq Yjbm7dKeo77P7fYDPRvQw6P2Rn95MBBgiCLLRBJdgZ3jI5ukipA5vJ8HgySHhPoEU1di BFZWCJmDHl5GLJ8aY+gqfkf8kx5ZttL2RtXC/Ql3Ki/Aa/NRj4W5Zr6eQT82BuKzC1Ur KUhRBmcR51fQpNBlss2E2bE9/AnPajDtr+l4udgttb/GkrFq+DXldGtrzwbMp7g96725 kasQ== X-Forwarded-Encrypted: i=1; AJvYcCXYgEz4s4fao/C7pKW8rJySQnEwKjxW+JZG59GM1rOrgWZQnjZQxLPKg4C9AFD8IYyhzdqSAmBLuw==@kvack.org X-Gm-Message-State: AOJu0YwrAY8Uwoz0oeV574Y77mcwvSQr1HkK6aO8Iq4W+I4c7pd5ObF2 NLmX7i6/X/XjXC59Jqi/a1o0PPBb24jPVduYnF8O3KIVud7wXXYY4Y/Gtqe9Nufdg7XJtmem5f0 GiWZ+RzByVV8uJw4dZSedEW2DOxYjxkyoo4ic+176TNEFbzsC X-Gm-Gg: ASbGncvVALjFFwEeCMLb62xclIh+a2zvwzOlJUsu71gSHznwbvkp+P0xG3nA+0UTyZ5 gHdARuU3HgPXsfuT+BI4BxW4rE1jMDhXFDZyRVihRsd17c9Q46HPLUypKCy6n+e7Cm+SW6pHUQm 7dnmt2NSjdpwAng5buvX+xGYTkyFiFdQnBuNwww4J4JFZMbgjtk/0lR+yLgcjzfC0Nm+mZvHRGy 1CE2sJiIR0TOA6D1qmxD3b53AmR9k0l7wsS8K/CoPINjijbKRA/yOBL X-Received: by 2002:a05:6214:d42:b0:6d4:139c:cef0 with SMTP id 6a1803df08f44-6dd233545f9mr613361326d6.22.1735913584386; Fri, 03 Jan 2025 06:13:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfkd/y94j3GT4Wbl+HKoDQCS+Wdl4LTiVrVxLBddmSAc40Cv3s1aAQJ8NSfXvBDEghvCYI7Q== X-Received: by 2002:a05:6214:d42:b0:6d4:139c:cef0 with SMTP id 6a1803df08f44-6dd233545f9mr613361166d6.22.1735913584092; Fri, 03 Jan 2025 06:13:04 -0800 (PST) Received: from [192.168.2.110] ([70.52.22.87]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dd18110112sm141968806d6.33.2025.01.03.06.13.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jan 2025 06:13:03 -0800 (PST) Message-ID: <84b5ad54-8765-4a38-a032-ca7fb9978c2d@redhat.com> Date: Fri, 3 Jan 2025 09:12:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] mm: alloc_pages_bulk_noprof: drop page_list argument To: Yunsheng Lin , linux-mm@kvack.org, mgorman@techsingularity.net, willy@infradead.org Cc: david@redhat.com, linux-kernel@vger.kernel.org, lcapitulino@gmail.com References: <0edbfcf5-db26-441f-ae9c-f85985cb8b68@huawei.com> From: Luiz Capitulino In-Reply-To: <0edbfcf5-db26-441f-ae9c-f85985cb8b68@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: b9dNnnBXm9oOnd1f-Z4yfjMTN8n2MpAhU4Cti3ymmiM_1735913584 X-Mimecast-Originator: redhat.com Content-Language: en-US, en-CA Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F54F14000B X-Stat-Signature: e6in8jaz7nkq4j1egatks8ci5u6fmcbs X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1735913551-400856 X-HE-Meta: U2FsdGVkX1/WsC5yJWTC35BjFg2h4pi4A0fasaO3kTGd8Qc9eRSvxsv2b2iJ8RxcF0bz710COScvkurO+IT5Rzsvq+8gGqucsReCw7KzEoFLKcbYQaEac9INVfEAgCNPz1lnoFjyxQUuABnX0Uagm09kTG+KDVph92kRIXBdnT7drYbH2kzNAGZYCLavQwRu5lcQqsuS+LzJBBErg7bN48V7+xSeg0OtdowsGgFwbvc5vXV/uHTyQcX+ixTAdMXgVDgLwNomkv2p63+KndeH96CSEjM/pVvFPJz2LOh5Mob5ZIfhZi7sIGVagwAqL0oJ47awSEqSw51MYHw57tG4FYdalDPYspXm4J3sw7L7vggc6DSjqbH+/kjifMDhm54DTzMPqCBClE3ujHjjJxTYTw0PhHR04JvFyRokWjrAYSI9lRgVuqXr0sL4huCcFtZfdvFOCw24jdAfqyiW09JeA94Xhr/f8YRTbZV4Zg5NYkLKHATPRCcsKRMnL3fzhPfbQ7mYb4QxOvLCj82gan+2PHUGhKGQtKbTuz0r05EvyzLUEmFf1x7rWBHcXU/hF7BAM0ZBmlXxcQks2I4E/qSYPArHYSOElB2e3mhO5sEz5B3mckxryASIPdmc6S4siStyYA0czwoX9YJi8WY+9GiHHajs+XnGFhulBRo1udooi1mbV/hYhyLRz7pR/ClP1O0+B/zCcTsn51D4yCaI2CAGoj6vMUr0xAkegFCX+Bj2dmWRk0eCHN/zbf/W05rjdRauoIsxvJ39J0clXjC1RiBp/vZYKbTJjVvYv+er/IKHD2fb8hBMw4cQeq6E/wuiPkc/2XhE52dWL6xUJG/JULQqJqPDhoXbrHiuXSGDrwa2k1gVNGejFi0DEFKPOP4iB0x8OCI9snXjSvPsqyuRFuOFmZIi1m8Y7K0cUjeZpJevtYfD1QT49e8cCYhKmxB4oZd5m5k+Z8c9FOuYH+3N5T+ Ux7y1XRM pgvUs1bcIocHhIVdbjsLLDeGTMBHxbtriKM2RL9YsaFmOrz/dbA7GGc6DiCkoxUwLzoQzO1RdcEQng3jplUbsEhz7YtULEABgvgcMDsOohs031xJPfzu1Qneg9mcBHfZkgm0wF4s07c60iCqhhuVcTuUbSZHdP6quUIbc8e3ebENxJaRjnZ8yPgYxvVwgwuwkNQHTbd9QNeaHmCkdrRfoyTAv1aGi+LWTHlLZoxQVJEUWGrIXsg/HJZlZoGj2Rfv4hEZQP2w52E3gSIepn+VU4O7OFARDKreVHCj3CFsGKQxGdz/f2qc2vbjF0LQXhjKjz0Ildxw73BBPavWG8hbSJwtMat1qGpg8A5oZe+CfkV6pldfWUs6ccdOFncxTPAlXYrFjOHhxfBGuQBZV/zNPS+dBBytXkEkQIgF+Rm0dBSSHqNvBCd52edeM1acXPlVI83OF6PLBLnMu8CY= 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: List-Subscribe: List-Unsubscribe: On 2025-01-03 06:21, Yunsheng Lin wrote: > On 2025/1/3 0:38, Luiz Capitulino wrote: >> On 2024-12-25 07:36, Yunsheng Lin wrote: >>> On 2024/12/24 6:00, Luiz Capitulino wrote: >>> >>>>   /* >>>> - * __alloc_pages_bulk - Allocate a number of order-0 pages to a list or array >>>> + * __alloc_pages_bulk - Allocate a number of order-0 pages to an array >>>>    * @gfp: GFP flags for the allocation >>>>    * @preferred_nid: The preferred NUMA node ID to allocate from >>>>    * @nodemask: Set of nodes to allocate from, may be NULL >>>> - * @nr_pages: The number of pages desired on the list or array >>>> - * @page_list: Optional list to store the allocated pages >>>> - * @page_array: Optional array to store the pages >>>> + * @nr_pages: The number of pages desired in the array >>>> + * @page_array: Array to store the pages >>>>    * >>>>    * This is a batched version of the page allocator that attempts to >>>> - * allocate nr_pages quickly. Pages are added to page_list if page_list >>>> - * is not NULL, otherwise it is assumed that the page_array is valid. >>>> + * allocate nr_pages quickly. Pages are added to the page_array. >>>>    * >>>> - * For lists, nr_pages is the number of pages that should be allocated. >>>> - * >>>> - * For arrays, only NULL elements are populated with pages and nr_pages >>>> + * Note that only NULL elements are populated with pages and nr_pages >>> >>> It is not really related to this patch, but while we are at this, the above >>> seems like an odd behavior. By roughly looking at all the callers of that >>> API, it seems like only the below callers rely on that? >>> fs/erofs/zutil.c: z_erofs_gbuf_growsize() >>> fs/xfs/xfs_buf.c: xfs_buf_alloc_pages() >>> >>> It seems it is quite straight forward to change the above callers to not >>> rely on the above behavior, and we might be able to avoid more checking >>> by removing the above behavior? >> >> Hi Yunsheng, >> >> Assuming the use-case is valid, I think we might want to keep common code >> in the API vs. duplicating it in callers? > > I was thinking maybe adding a wrapper/helper around the __alloc_pages_bulk() > to avoid the overhead for other usecase and make the semantics more obvious > if it is an valid use-case. Yeah, that might be a good idea. > >> >> In any case, even if we decide to go for your suggestion, I'd prefer not >> to grow the scope of this series since this could delay its inclusion. >> Dropping the list-API (and dead code) is actually important so IMHO it >> should go in first. > > Sure. > >> >