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 8321AC433FE for ; Wed, 26 Oct 2022 06:53:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0F208E0002; Wed, 26 Oct 2022 02:53:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBECE8E0001; Wed, 26 Oct 2022 02:53:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D87328E0002; Wed, 26 Oct 2022 02:53:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C63E48E0001 for ; Wed, 26 Oct 2022 02:53:29 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9640F120946 for ; Wed, 26 Oct 2022 06:53:29 +0000 (UTC) X-FDA: 80062184538.19.7A1E6E0 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf15.hostedemail.com (Postfix) with ESMTP id 07FEBA000A for ; Wed, 26 Oct 2022 06:53:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 78464B82116; Wed, 26 Oct 2022 06:53:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85B01C433C1; Wed, 26 Oct 2022 06:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666767206; bh=rCvWVoSsjxNZoT/rLJSbP3vsvzUwK8xeZr0oV8v2dew=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0OnNK7PvKMzyTarkN3gWiQ21QIuGixWY50WlEwThZFWIFQDbCe8uVCngpTlVK42Pc n0h6GTJ8pyGxFrVkNsVfeR9ODowq54eYiuj2tKzylb/PDF0vsGOYhWqFrGZ7S5nuru 7MSAofEsG1IUJGeCD0c5jTsHQiK0AJH7zM2Q6ul4= Date: Wed, 26 Oct 2022 08:54:19 +0200 From: Greg Kroah-Hartman To: Catalin Marinas Cc: Linus Torvalds , Arnd Bergmann , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Christoph Hellwig , Isaac Manjarres , Saravana Kannan , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 0/2] mm: Allow kmalloc() allocations below ARCH_KMALLOC_MINALIGN Message-ID: References: <20221025205247.3264568-1-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221025205247.3264568-1-catalin.marinas@arm.com> ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=0OnNK7Pv; spf=pass (imf15.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666767209; a=rsa-sha256; cv=none; b=rSh+vC9FTLfHdZ8KNnC5DHdgb6J3DpVNX1Vv76FNHLqgPy45m6oji0Dx4b3VLs/saGVGHG cMeSyjTZy8YdEJKmkeiozGlUAKlJSy6NHBdjnidVanzh5QFx2tWvtj/zYM5qb9YNg6ML1G ZIkb5nbBwRjUQuNQwG8DHSO6qvAAGQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666767209; 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=KNQwfIIXee0G7gBpjrrfNxFDJiTFh04KrMqhn/F2JTo=; b=PGXMoEQSQjurw5jEWqJ0mzD/EOMNTYQsDlIZJtGblrFKAta58ozOB22fWijQtaSizUa4i0 Yk1M4t0z1p6SYGT3rZksUuoCKR7s/EOI0rgV+88gPVOj1eJ0KZiTVWLFfRjpADfNyi8hXZ sJNJXlg/kRCkk5ucXdUURmMSGBI1WJM= X-Rspamd-Queue-Id: 07FEBA000A Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=0OnNK7Pv; spf=pass (imf15.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Rspamd-Server: rspam02 X-Rspam-User: X-Stat-Signature: pamsbsfyjtbx4a3ejtsdbs7kc9ojj7aa X-HE-Tag: 1666767208-490752 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: On Tue, Oct 25, 2022 at 09:52:45PM +0100, Catalin Marinas wrote: > To me, the ideal approach would be __dma annotations on pointers aimed > at DMA and using kernel tools like sparse to identify them. As a reviewer of drivers, and a subsystem maintainer, yes, I too would like this instead. It would make it much more obvious what is happening. > dma_kmalloc() would return such pointers. However, things get muddier > with scatterlists since functions like sg_set_page() don't have any such > pointer information (can we mark the offset as __dma instead?). Drivers don't always call dma_kmalloc() for pointers to pass to dma controllers. Heck, I doubt the majority do that at all today, that's the main problem overall that you are having. We can take the time and move the kernel to do this, perhaps that is the real solution that will work best over time here? thanks, greg k-h