From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796312414; b=qsxQh9tK5I+nd+MpnCUEi27T3Ip9sftwmefQcrh0KspgCorFTx59+nznLiHGqTIceMHt XkaHYi/jFA380NnSIkLcGAWdy+Vcsx/2T6LsoegBz2YI3YbODVYh4MLFH/Xf9b7yDa94n w1VhPnCrsJCloIYDeEc5hwO91nQ0qPtiabOyK8wAXhq3ojELQmV/Wss6d2mZuMzo/MwQZ 3Euw3kZwPWp/jr3w/atB+76tR25GBljawF/SOzTL43T1K7CJfoelqrLHEqT6hok11rWOR avLaIcoHXQT6FWzBkqxboCiqtKr6XogPzr/NA/tZZL6ag4Q5mm7gVD/1E32oVkrO9hw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312414; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=g+WrmRiFjAKh0JthA3PXbSOZFW7rIP3BSqvUFe3FgM4=; b=ITCXkcdhoaxEbdhdizY915oy35Am/pFqnmN810zatp8+0KcqDunDw0EvJPL7HJUZB7NU TtP6kUk8t/mIcKEbgzV8SLN6XR59a+a5sWLGyptdiwl2rqKhA7GNGbpMc1xhTB6e1s15o 3g/eYh0KF6CyYeYwoRY5zH61fCgvJGPvEQ4Vx/FxUGauETuc1Y//9Rl253VZfCLlVuqM2 AWMmeqQpglGYg+Qi+ojGJZKp4xYkp107puQh+JBDNLjxMgRKAawoj9LXYSlltgDIJ0in+ LO/5cisRBayYtsb+Cuemcc6I5ZAwKVJGUWFa20UwvwE1OE3e/hv8qkzQoRArH68z8Kg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=D4OG6NwZ; arc=none smtp.remote-ip=74.125.82.48 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5CCB606A334 for ; Thu, 3 Dec 2026 15:40:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C5CCB606A334 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=D4OG6NwZ Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-1a2761c69fbso423148c88.0 for ; Thu, 03 Dec 2026 07:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1796312413; x=1796917213; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=g+WrmRiFjAKh0JthA3PXbSOZFW7rIP3BSqvUFe3FgM4=; b=D4OG6NwZatMRVB1wt+RCsx1yDBFwvD5DU+DvBr5atvxtRi8TktJdj+jwA5rx5LYs8o Ex8eLWgAT305Hks5n6b0H3WA7+d2cTh6cWE5HDZC+so1kJSiTXoPnsFsNwU871pAzzTk 3ZttTGtfOh7z4PUWxaN0sNpD7z3I5fxBt0USusImcRJTpLVZurXK4iDnnadm4DV0q28R 4na+O2YZXdzo7Llx31vOh/WZ71qkDtq9g2EYeNdisCMand1E9C2dstkXLi5GduQg5dhO J9Edje2HDmDKbHeweE5m3B+6FaYEeDxJOrV5tsUDNiLzD2Ycwgnzs7rX5HVQAM7kyd1h 5tjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796312413; x=1796917213; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=g+WrmRiFjAKh0JthA3PXbSOZFW7rIP3BSqvUFe3FgM4=; b=M2SvGw9ZolmYJYiIekB7G/Nf6d5gKYVN+M3Hx/KW3zPZvhg5rmkGaL+fsxlpFLJsBX YAK3S7nwRGfJUYUmAasZaMH3O0jeBROekUXRU8ymlZJeSFiLofhioljrEEYrRN8Fk5Kd MjhoikXJZ6pKDbnvfGfBo4eLQMM/aCFy0b1AXKb6HIJUfEs1Nqi0BQaOrECNQkuSBhg/ OGV5tw+3mHiEfLGbJcIQAtkoA0ioJGsi5MZwhmc7WF+xM7TPQtpcdJ2s5D47rbBD4fbb TkhpwGDPzQ2tuWrBL6OxFZia0zgFICwVcreuzXq6I93Qfn+oDcv/kCqrJ4iXIcW5yMbZ GG9A== X-Forwarded-Encrypted: i=1; AL+hErHArM4y0enBMV8yf01CzZTQv1Tx/n68CNh7l00BZzVoZaqiYPwmyBr5FxD07CIXgTgivgkaBqHp9iiA@lists.linux.dev X-Gm-Message-State: APuU4Z/58j0FS+U68+cUsa1gF4I6CAixvxCx756Fb4T5sELrm1Dx7o/b driNFnvtOeGOFHX+QWSuIeSJyU4AAsFou3jZeegnbN7vA5/lQLETD2ux1NLWtLbNP6s= X-Gm-Gg: AZFdTZe4O1G3q9ZNZd9nzmz9/pS2gb9Hm95tktizkHm2eD40JXr4IktwEb4OcfI1KSg e9YMPM6Rxk7WgWchzzYXPf5O2oYcte4aRASvSvfXiNJ/Dxh6+GsnTJmhJLGJJ6AXxyuONRkk5qe kw7rR71azqgnslGGPpBp0kpXCFRRPgBKS1XpTI5Q2Sroi5rVALn2HhZmGEitF9uS9dKoihUaE3p mOfknrkFS0InNc9PeRqF5oqYL2msiYXMoCjjPnCKmWPEXYW5UjEMhQJY4rWT177WFTITLUbSmYd Mgl8qyc4Oh9HpPrGyKcw7mnhTSe9NvLwYvGMTX2rbdfJvrUcgqJmBYxrhdHvJN528reTz+VBNYB KplcioKt+a8MxrFlpjxHEDIr2hBgOWBEObszr/19Heh2yWEIWMvIu8WlrBtk5w9mp7Nw5Sda3IH Z6djvBIsSGKmrqGUrjo8Ii2jHsHxzDJ7i3lb9Bhqx6/xBC77ND0ksS+KIG8lWe5h7eg2qaC9+nb SCzsgqnNfobfHKNiNONB9vk521jxVN01V3gFaVacGPMKuJ93DgmfDz3pRkAkiwF/2iZ5ufZfAXm LBE= X-Received: by 2002:a05:701a:cc88:20b0:13e:5a50:1e17 with SMTP id a92af1059eb24-1b556823ad5mr42325146c88.3.1796312412690; Thu, 03 Dec 2026 07:40:12 -0800 (PST) Received: from ziepe.ca ([140.209.225.78]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b55682d301sm106608064c88.10.2026.12.03.07.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 07:40:12 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xZ8up-00000006liy-1Iqj; Thu, 03 Dec 2026 11:40:11 -0400 Date: Thu, 3 Dec 2026 11:40:11 -0400 From: Jason Gunthorpe To: "Aneesh Kumar K.V" Cc: Marek Szyprowski , linux-coco@lists.linux.dev, Andrew Morton , Catalin Marinas , Christian =?utf-8?B?S8O2bmln?= , Joerg Roedel , Marc Zyngier , Robin Murphy , Steven Price , Sumit Semwal , Suzuki K Poulose , Will Deacon , "T.J. Mercier" , Madhavan Srinivasan , Heiko Carstens , Christian Borntraeger , Sven Schnelle , Dave Hansen , Kiryl Shutsemau , Rick Edgecombe , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Haiyang Zhang , Wei Liu , Dexuan Cui , Andy Lutomirski , Peter Zijlstra , Alexander Gordeev , Gerald Schaefer , Vasily Gorbik , x86@kernel.org, dri-devel@lists.freedesktop.org, iommu@lists.linux.dev, linaro-mm-sig@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mm@kvack.org, kvmarm@lists.linux.dev, patches@lists.linux.dev Subject: Re: [PATCH v11 15/23] dma-contiguous: Derive shared alignment from DMA attributes Message-ID: <20261203154011.GB1074888@ziepe.ca> References: <20261202095446.2029567-1-aneesh.kumar@kernel.org> <20261202095446.2029567-16-aneesh.kumar@kernel.org> X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 03, 2026 at 08:26:42PM +0530, Aneesh Kumar K.V wrote: > Rather than passing an explicit alignment value through the call chain, > I thought it was clearer to pass the DMA attribute and derive the > required alignment where we check the CMA limit. I think that is broadly right, but you should not be seperating the cc_make_shared() from the allocator, if the attrs is pushed down then the actual allocator function eventually called should be a shared version that returns shared memory. And then of course that ultimate allocator function will do all the alignment adjustments internally. That is a much better justification for passing attrs further through the API, IMHO, because it is about calling the right kind of *alloctor* not applying some weird alignment adjustment. Jason