From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89E8821A434 for ; Fri, 27 Mar 2026 12:35:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.218.54 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774614938; cv=pass; b=QZx5pJMu5T7GdvitQAVIGubvQpcVVuYkdCXJkdUuWV/j6TJ1y/ioGebKBSNip06Tx7VHlY/o5yWXcjdCTmdQrxyrrPrsYVXbGzFtzlYuAPs+09vmRCJHfB1wfvoOffZ3pYbs9YYA91Nqebj0bOnUL/XhMrXbDGab3Qb/oIIFr5s= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774614938; c=relaxed/simple; bh=5cOyBNoqrTish9nBBS87UAnS6CU3/R9H+gkn7UHvmow=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KhfjOmhR8Yl61d/FNIrmA7GjMkzVG/Ca91DMYTGiP5PYRDZJtUIBOqNHc4jScoRtSvy0OfnLgqNVMocmE9H3RumK0DZd8qjfH3H9AmBv45wJYEHmzOaUdIaqlTg/uzTt8s76JJBTwiAUtW+rrQMg8ev7Xk4O2V5L1wDX0UVHoWM= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hDTOTZSl; arc=pass smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hDTOTZSl" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-b98133bdc4bso241467566b.0 for ; Fri, 27 Mar 2026 05:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774614936; cv=none; d=google.com; s=arc-20240605; b=PcxGUrE5O4zyqXI9kZoKFr/JD2QQI9k5JLIxzYlkEAinK3BPb/rqlmDEX71/fhCFkv eQDERQC1u7E9t2VAi732YIdW1aOacUB7slkNFn3mAT5yUYEkuv7P1Ji+EMRi5/GtYmFL /FrRkdMNA/lgceooNoHoLfyu4ICaXqU0bPB5NXs3YdAdvsfwOHtotPl+g8qF3bMBRiIc p0xkVnmHMys9d6azDSUi0OMJEXjb+5gR5d14J7B8Mzy1B6kL7oEt4KChAno3cug3loU0 vD72auLL0sDQAgztcNvuJ15k+qePvjjNr4ZqIt5gzDW+M61bXtIzZYnIhILPVSW+iShS AMJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5cOyBNoqrTish9nBBS87UAnS6CU3/R9H+gkn7UHvmow=; fh=uP7IBIWGpUawkowniOWPZd93LO1QUdNU7BQUjJGdmRc=; b=arZKEYR3GnIG+SQ9VsFoO3C5f7TUTm6YXNRPj4ApQ7Pyue6eC0sJV5bis+dhJigooV 8BcbZ5XelhfzUdpgjtLr1T6qLkWMlYfstKTaqqmg1xw+GimnINoH5Ff0IbZBKSHdcpau NIXSaR46L83oC2/e0Xls1c/xGy2e6N1IL4S1jjHrK+DCKWjozNx3gSIEpLUPjZV5pK4t wGil8zn7yjTHcHpb1taZ68055Byk9cIfawimLFbloRXUizGsLpPsdMAFAiHgKP3+h911 XiRouElS27hfaID8etNVVNyAid/XIhDHt1SqrnkPhzcRQTZXeYx3CurZ4HarfWvWJGRu a6FA==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774614936; x=1775219736; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5cOyBNoqrTish9nBBS87UAnS6CU3/R9H+gkn7UHvmow=; b=hDTOTZSl8giVTfchqfV1qmgf27MF/qdda6lMtUPEsJgLk6b5H5LsQ0Jl5knXo6igdU ulAVPyKxvwSd392+aI7Kwq+ZD1q5jeL1x1xyCtt2ngLHEAt03Q5Xk95XW6/irQhCHY2K CaO9iunTyJdkP23j8YUKe1ppnFQ80erIFlhi31M+wMuGVIAu/Fhi/UxS8Vc0lK8gzjq5 WJl8CQnI+84YsOeo+RJJc8Oj5gACtNYk7uJ/61QA5aDWW0uga4QMfJMsOG1uQHCBgey/ MIPHguneBhfL6YFnMg13xV2NVGYVBAgwnDWKuD0ntV3caql4L7D26u1LKHpu2d/07kMp HZ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774614936; x=1775219736; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5cOyBNoqrTish9nBBS87UAnS6CU3/R9H+gkn7UHvmow=; b=U9IWBm39m+Yc/LyBdEAnkLHvEVHrfT4vF5YX/vtzbcSZfjLh+kg60SaoizfydJJMu6 xgETvwAKkYrzN7h3EaLb63k7QZBOIjnGLN1RMWYHGV/pS/Rtxb762DqWMGKZKqzKF91s O2ji9TPGTt+uDkdpqXp6qDgZmHFmWIG38jLWM4fb/QPKmA3w81MRuh06dLmN9COLDnvC x9kEYieSG1WvdETvVWZnQTldrWfRfh/dw1SUMY6zJjdHz3bdrVgpGTTjGjZP023g5sMa vzeCXk/LFjsGXW2c9R9EqT6WfPVfri7MsxXC3KHqE38K3HGI3xdJo882cSVWcRdA+PlB Y0hg== X-Forwarded-Encrypted: i=1; AJvYcCVy6oXyqVMRBHj4CJ+WDVUHA5OwHbeR9isJo+5HUVw6boSCsDH1wAL5QseMkV8pN4Dovoo0t4Oe88Npx0U=@vger.kernel.org X-Gm-Message-State: AOJu0YwwzU8j2C676/uvYf7tyxLjFeCrdQ8URN5DqzkQ9gd4c51DzazI VzjUrQgmNCmtfvNUrquyNvwdn75pwccXBvIiLHIf91uVWNGSwTCOMehFZsjntRWsFRLH4NaTH+Y En3ruomdh1/1u8/21UDRl2pD6MeADEwY= X-Gm-Gg: ATEYQzzCmV78+hExob+wmaAq6uS734HjMlinaOeb/anq+amOvW5dF8htK2cvhCi4KnU Qo6DUVhKzGtAn5Mi5wI+nb1+ll630X3I3tn1UBqgit7EsRSd9E1j7nPFsjPZYCS0yvUNrRUtLDP 94+IQHlksrvxGi5phmCpnjPiWfIn3JK2H2d4zCSyMUjYfjTh6GL6RU2JJdkIIJ7seqElCCUSXeG G6GA1mraR30G8jOzrg2RRBMY3KTEyzf1Vc4O2x5oUH192h6ohN84Bo+j+J9Dt94SdJ6IN+Ls8tK 5nXOqjf61+EMlbuiehecnUxgOZ+Qnw+k3inYca1t3qVGdbFQhoCT/ylFIUj93vppyWqnVhVWObC Zpi3HwS4= X-Received: by 2002:a17:907:3f07:b0:b8f:b32e:e196 with SMTP id a640c23a62f3a-b9b507b20ebmr158948066b.30.1774614935669; Fri, 27 Mar 2026 05:35:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260327055846.248829-1-mikhail.v.gavrilov@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Fri, 27 Mar 2026 14:34:58 +0200 X-Gm-Features: AQROBzAf3n6UCCCVOWz8_h19fmxDUeJxeUYrZ9qKYYIvgXaEOz3JyzyW2dWdB10 Message-ID: Subject: Re: [PATCH] mm/slab: align kmalloc to cacheline when DMA API debugging is active To: Catalin Marinas Cc: Mikhail Gavrilov , vbabka@kernel.org, harry.yoo@oracle.com, akpm@linux-foundation.org, hao.li@linux.dev, cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, stern@rowland.harvard.edu, linux@roeck-us.net, hch@lst.de, Jeff.kirsher@gmail.com, Marek Szyprowski , Robin Murphy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 27, 2026 at 2:26=E2=80=AFPM Catalin Marinas wrote: > On Fri, Mar 27, 2026 at 10:58:46AM +0500, Mikhail Gavrilov wrote: > TL;DR: I think this is fine: > > Reviewed-by: Catalin Marinas > > I'm not sure that's the best way to hide the warning but there > are no great solutions either. On one hand, we want the DMA debug to > capture potential problems on architectures it's not running on. OTOH, > we also want to avoid false positives on coherent architectures/devices. > I don't think reconciling the two requirements is easy. > > When DMA_API_DEBUG is enabled, the above will change the x86 behaviour > that could have implications beyond DMA (e.g. may not catch some buffer > overflow because it's within L1_CACHE_BYTES). Similarly for non-coherent > architectures that select DMA_BOUNCE_UNALIGNED_KMALLOC (arm64 and riscv > currently). arm64 defines ARCH_DMA_MINALIGN to 128 but > ARCH_KMALLOC_MINALIGN to 8 (why 128 is larger than L1_CACHE_BYTES is > another matter but let's ignore it for now). Maybe for the cases where we do not warn we should introduce a dev_dbg_/pr_debug_once()? At least users may be informed about potential is= sues. --=20 With Best Regards, Andy Shevchenko