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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1606C79F89 for ; Mon, 7 Sep 2026 06:11:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B9246B009D; Mon, 7 Sep 2026 02:11:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 969DD6B009E; Mon, 7 Sep 2026 02:11:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 858E06B00A0; Mon, 7 Sep 2026 02:11:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 659396B009D for ; Mon, 7 Sep 2026 02:11:29 -0400 (EDT) Received: from smtpin25.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EAAF7A4BBA for ; Mon, 7 Sep 2026 06:11:28 +0000 (UTC) X-FDA: 85185944256.25.A04B819 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf19.hostedemail.com (Postfix) with ESMTP id 4B6BD1A0007 for ; Mon, 7 Sep 2026 06:11:27 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=lVs8Xu5r; spf=pass (imf19.hostedemail.com: domain of rppt@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1788761487; b=jHYrW2Vz03ofnSe9+XoFsGr5Ydx1Z+MowG4F41Ew0P4leJc5hYvooVKEZwu7YOw8VqvV3x 48FXyOmoSNsq0s1rFPLNjc5us6mJlAoAxzJpYvcjfcSa9mFaBYxBnVbBrCULpM0/s3fQvJ Bl8klzk5m5gcYGw5Glif6m1GkLn+Dtg= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=lVs8Xu5r; spf=pass (imf19.hostedemail.com: domain of rppt@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1788761487; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P3dmwjKWC6Wefq3ZCIghBfeiIweYofYEsPr73KhRS2U=; b=iNAiJNKvcMTjkB802UhWjAoHLxCvmtLhFGxHQBDfFQAwln9mgdO2rvI8pEGs3dEeDt5atX B4kJIVBd8j8x3UMHJOpKOpMKZpmWD0zgcQr2scrUxqO8dOmVo4xUHHE7HbE+QUYMgGrOrJ TxaRA9IgvZkBsd+NnUud72aQFwHPp7A= Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4384943E11; Mon, 7 Sep 2026 06:11:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6B1D1F00A3A; Mon, 7 Sep 2026 06:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788761486; bh=P3dmwjKWC6Wefq3ZCIghBfeiIweYofYEsPr73KhRS2U=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lVs8Xu5rqDz7930qIA7wlWJw7qb10AZRIm5YTTMxjRCX2t4BjgpcgVLZXPFoE2zuV 4M9SQHuqpn/loOucuyWXztqjFxihFRGD56lGccTw/1aKzhqr+FH50miDZnNnJJTcge hrFj1FJ/PnBupIUwR4OzjlZwAhRsQglnRhNbbhTtDkDe+eoDZPXiFLVvXUzM7f8S27 KEdQ1IhnCiQ0qOmOch6tMR0gQjP7UBAb1uLBnTN5/9d2zn7ISWoLN9N/5bnBQKWNjQ tkjFcPJIC12n54uQoRw8+/rW2Oom44GLwphExcwF37vyG8s3lzkoYshwdmTmvDwhXs KhuinYov4BKRQ== Date: Mon, 7 Sep 2026 09:11:18 +0300 From: Mike Rapoport To: Eli Billauer Cc: "Vlastimil Babka (SUSE)" , David Laight , Arnd Bergmann , Brad Warrum , Greg Kroah-Hartman , Michal Simek , Ritu Agarwal , Andrew Morton , David Hildenbrand , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 2/4] char: xillybus: replace __get_free_pages() with kmalloc() Message-ID: References: <20260831123937.32255a49@pumpkin> <1729fb06-6beb-f8ef-3e71-47fc3f00345d@outbound.gmail.com> <9a3d6a08-339c-3315-cc81-46907d0836ad@outbound.gmail.com> <1d7f8806-f4a0-fda0-a361-a011460ef308@outbound.gmail.com> <3c19c24f-5036-4bbe-b3af-e5eae102f34a@kernel.org> <49245a34-cc56-736e-b2b4-168c2a0b1df7@outbound.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49245a34-cc56-736e-b2b4-168c2a0b1df7@outbound.gmail.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4B6BD1A0007 X-Stat-Signature: o15cpw9d6rtaa5pkeesu5mxkot11k53h X-Rspam-User: X-HE-Tag: 1788761487-871123 X-HE-Meta: U2FsdGVkX1+TvBM3XT9hogRn3HyqBBuwXqekymz/uv/1TmvF1Jn6yVGbt/6wJvxllvEKe4gp0hV2zMIMoUYL/VifFDVkL/vsBxM7C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bEUIIQmHLv11Ivd7toD/oJo464FqCivBAI3qn7eN79ONBhk3afNBM4RtoIB4n8UJnJdZRUZLBpBcESP1u4dRavLSCie4tHF3HehNU+zP/bZ4aCd5KQRf45tTclAYMiJkhyiBrl5tYFiv8S5LfB4KUPnlK39K+FHvKouPP02HAN9Dwd2hGZkpN5o4ltgkQE8E5Xo Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Eli, On Fri, Sep 04, 2026 at 05:29:16PM +0200, Eli Billauer wrote: > On 03/09/2026 16:28, Vlastimil Babka (SUSE) wrote: > > > Replacing it with a kmalloc() is confusing in my opinion, and requires > > > that the reader is aware that kmalloc() falls back to __get_free_pages() > > Why? The reader has only to know that kmalloc() will provide such a buffer > > (up to sizes that the page allocator would) and whether it falls back to the > > page allocator or not is an implementation detail. > > When I see __get_free_pages(), I automatically assume there is some ugly > low-level memory management going on, which is exactly what fifo_init() > does. However you allocate memory, there will be some ugly low-level memory management underneath :) > kmalloc() feels like something you use more for allocating memory for > a struct. For that we have k[mz]malloc_obj() now... > There is no such rule, of course, but this is my subjective view on these > two functions. ... and using it to allocate struct is becoming a rule pretty much. > As I wrote earlier, this is a matter of taste. Maybe it's only me > thinking like that. Let's agree to disagree :) I think it's more about using the right tool for a job. For your usecase I really think vmalloc() should work. Presuming you can spare 256MB for fifo buffers, the driver can only run on quite recent and decent hardware and memory rates there are way higher than 400MB/s. Even the slowest DDR3 is above 6GB/s, so taking a fault to sync page tables on the first access is really a non-issue. > And as I'm not the one deciding whether this patch is applied or not, it > doesn't matter so much what I think about this matter. I've humbly voiced my > opinion, and that's about as much as I can do. > > Regards, > Eli -- Sincerely yours, Mike.