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 DB9ADC001DB for ; Wed, 5 Jul 2023 13:40:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C47E8D0002; Wed, 5 Jul 2023 09:40:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 474188D0001; Wed, 5 Jul 2023 09:40:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 314998D0002; Wed, 5 Jul 2023 09:40:42 -0400 (EDT) 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 1DAFA8D0001 for ; Wed, 5 Jul 2023 09:40:42 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 87DD81A0AB4 for ; Wed, 5 Jul 2023 13:40:41 +0000 (UTC) X-FDA: 80977668282.02.26AF515 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by imf25.hostedemail.com (Postfix) with ESMTP id 8FE73A0017 for ; Wed, 5 Jul 2023 13:40:39 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b="S/GzS4Yu"; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf25.hostedemail.com: domain of amit.pundir@linaro.org designates 209.85.219.42 as permitted sender) smtp.mailfrom=amit.pundir@linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688564439; 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=OVl7S6svfqIntE0S0D0sZ/BLm4TgMTlV195W9gSGqjI=; b=f8wSP0oMk5LHaAuNYZT2yuVvTK6N0neV2vsOPx6SO5ko+JKirjylFRg3SbdGjwCxh0MMNf ag6m3jUzKN0KnmPPUcGFPOoMocy+0yXwtOyY/uTSHVS7HmvXV0GCmx6uo9kqcJWP4NBYt5 xlDTBNiJBLgv2oSliXoDzINIUgBI9mc= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b="S/GzS4Yu"; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf25.hostedemail.com: domain of amit.pundir@linaro.org designates 209.85.219.42 as permitted sender) smtp.mailfrom=amit.pundir@linaro.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688564439; a=rsa-sha256; cv=none; b=MLnbn6pFC4jXfnoLXEgsJqPc/gDwSDgoSu0seynN76N4Dno/ZZ5O0mMaLePD4uyviZUig8 7mgWlJsMlHFp53rFN3sP+v79LqtV9cMgW2P1qGHqySURJNtB9i6yz7VivXJFdx4fKl5nDB nYQgUZolPOFSY2GgtyeVtq+AsR8SL0E= Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6237faa8677so33527886d6.1 for ; Wed, 05 Jul 2023 06:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688564438; x=1691156438; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OVl7S6svfqIntE0S0D0sZ/BLm4TgMTlV195W9gSGqjI=; b=S/GzS4Yu/u1Ktj/ZQgqK8bBoepHz0jbR+VqbAnF0Hik8LCCrxyUQEvmBUQdXvHoKyj 7wPRdc1Gx/vD9F6EhxsQhdtoiDGmTTa4wI+/oTkU+mMcsW8cpHxtAc2rsXSZgGiH6b4z FClKjjULBujaw8sKVsMYTfQs5HQlzzM+8a71Va/t9WncsybaI8kpOEvfyfwBnpIw11X6 fxvHMeqm0LxcdU714hBHIjJMWg8NLPhbGOSKlJ+vpt1hgSD13esnyD/TJqyL/M53oMNK lPe/xfqZQzDLFGSPf3CeUZE4jenYiSzpsk69BJWwinBFQCxS69s6AvEAf6o5AcKc5ptM UKUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688564438; x=1691156438; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OVl7S6svfqIntE0S0D0sZ/BLm4TgMTlV195W9gSGqjI=; b=UPu0dvQv15TS/ZHv0EauDQ1J6vn2OCkbbyjPSx7ih6yY1m9LwaVUgg/1Yu/4EO7dxS Yn8u0GIpwSFY4y3097jIWxIQlnYWnFuP/5GXB2RY+OD5vp/L890uBqF8rCYKo37UXSWc 3yhldha+fZuFD5SYHqqyR25cWq5Hj0vjFdmsaDRnGVS7zwBPopbgbM2IZuC1Ov3chgKW VjI9rku+JmMnjBuaod9us3PW72lmOwWAXxDm1Nd+RHZGUa2mlItyAoxmFqXhequocaX2 g6JN9BErVuyBSTgw+15p68E1sZoD7ShlHERfgbAxXnbw867b6FKTXsc0RpVuRjQ0ELEC ZVvw== X-Gm-Message-State: ABy/qLZiRySUEWNbRRd4wwuE7IJZ73aA/syPgkrmZgy07fXzFYQEuXgo 8jRgKgx58ALvQoOVI4AU8cMYfD3aW6EdOmlNhoAUrg== X-Google-Smtp-Source: APBJJlFuWrcMdffrgiGAPowe14BbSPjQvY6jEOP1IVPswkR9U1SExJXl45gInbXylx8/bDqkstvmwPgsWSDcq8TTVbw= X-Received: by 2002:a05:6214:27cf:b0:634:7c34:6c96 with SMTP id ge15-20020a05621427cf00b006347c346c96mr15049376qvb.7.1688564438448; Wed, 05 Jul 2023 06:40:38 -0700 (PDT) MIME-Version: 1.0 References: <20230612153201.554742-1-catalin.marinas@arm.com> In-Reply-To: <20230612153201.554742-1-catalin.marinas@arm.com> From: Amit Pundir Date: Wed, 5 Jul 2023 19:10:02 +0530 Message-ID: Subject: Re: [PATCH v7 00/17] mm, dma, arm64: Reduce ARCH_KMALLOC_MINALIGN to 8 To: Catalin Marinas Cc: Andrew Morton , Linus Torvalds , Christoph Hellwig , Robin Murphy , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Jonathan Cameron , Vlastimil Babka , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Linux regressions mailing list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8FE73A0017 X-Stat-Signature: 9wxtmih7mbn4zkde499o763i63w8x6ry X-Rspam-User: X-HE-Tag: 1688564439-175653 X-HE-Meta: U2FsdGVkX193XxNff6vl41hmrCw9k5Q1ctNfl1MJuIW8trLUgc8MBhZGw5Ln1Rz+NbnRA9A7tNac4IanpknCVgAfz35X6xYSFPi/EAxWSi3V2H6bEsISt11GONgRveR/LZ6WnCuAmPnDtQ5TnDKzwDdCDRP6t9/cMQ6ORd2D/FpjSSN9q/bhGiwzF0QyrQ5NQtnvNhIHG7ZOzZP7XFUhtWVOyHn7QkiJyaIBDSFc1frSo/ttEa92PASEm0y4wfeDF2FLRIAyipnSJ2hvhMRvWDi6O4ZHLtCfhqKGJ5u3FyjdZAoiSi1i5aCOpkN83wULTEwHIF8TLBw+GpdBUyj2nxOdEK97NizUwI0ol7dNBVwCK75JnX2ROURaSFlHElTIpWlfD82iHZb5hlJaXrQwpzb3vBsouU8qywMp3SHWFPWu6Ic3gaNMZhnbi0CBBRu10D9++kvAFGyBvycgA3QaITMJIhH2V3bu7jWBXFCKWcvS/jt390MZ78QPbcynGzXQ0klUheCHhH3LUZTTqu65lhE9vKCbbVksVFDaz/eR6UA6NYFPc8fjw5h6xufn4GWAUSSNLeOOD19oBVstJa2zSCExcL8OFGW/aIJmx7hQCwuj9SKNdp227xUENSCElqjm8qze3koLqi6ZEdoMEWxNXkfxJqp21coXJqDKBRGYKXVaY1XjGZXRC9pDXqcitG4KvA5TZeb5XJnp9JRdGGbmN2aU0g00Bu9fYyetaimMdJewjNs227VTtttJ7koYd4Er9gqH2dtZKvW4ehaZnxlTrCV0+quU1EtSKXfPkQPyVFvMtsbMhURGr/xCOPI9xAGzubBNTzKPcfXsQPWiKGALAZJwrC1QqB1hiJZPO04A8rdIFLJYLaVk8l1X9p1xcOQT4tB2MK7vCYLuTBLEQgOppmJJJUjiYLSzVLFbOlQzKoi/g/pNWHzAQol2db9y0g9/FuGEFadinqGBK7bdklK 2WKJ/nLm +v+ilrLD0jPJlb7BqYRoaepb6Xecqsv5UbiR+QOqmM5+FcWdy3Q3Kmmv9L3DAslH+dZiCYXKoCLXx1HgPGyjcBCCQAgx0CWTInue67RJP0moauMHZqfwqoEEJpXocX0CRdUk0rfDSI06xiE878TsUruyP+EP7tqglUSC8b+55xzZ0/KtAO5RGqRRl7UZchwOcCILow50HAv9WkTQ6N6HC1tMGXCvl9myGFIiIlupFLORwlFV0VVV46VLYfLq6V/K+VGgni4zJ7+yVw2qNlsXEQlxVMHfsqpeWwzKwMySO3RXLgEoRGAAJNkmE7pB7kspf7fxwuou/8+0Sw3FdpixWEl9BDkJY54AtejunWBbVJ+1VOTsBJfXrKgDhhcaxpTgZQ8jZ67sHJDkOGYYL4718b7pbKH8aECROsjJOppzYFa+Iog1rRpACqX17C61xW/UZiYg/ 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: Hi Catalin, On Wed, 5 Jul 2023 at 18:17, Catalin Marinas wrote: > > Hi, > > That's v7 of the series reducing the kmalloc() minimum alignment on > arm64 to 8 (from 128). There's no new/different functionality, mostly > cosmetic changes and acks/tested-bys. > > Andrew, if there are no further comments or objections to this version, > are you ok to take the series through the mm tree? The arm64 changes are > fairly small. Alternatively, I can push it into linux-next now to give > it some wider exposure and decide whether to upstream it when the > merging window opens. Thanks. This patch series broke Dragonboard 845c (SDM845) running AOSP. With this series I run into random oops at __kmem_cache_alloc_node(). Here is one such boot log https://bugs.linaro.org/attachment.cgi?id=1146 Reverting "arm64: Enable ARCH_WANT_KMALLOC_DMA_BOUNCE for arm64" fixes it for the time being. Regards, Amit Pundir > > The updated patches are also available on this branch: > > git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux devel/kmalloc-minalign > > Changes since v6 > (https://lore.kernel.org/r/20230531154836.1366225-1-catalin.marinas@arm.com): > > - Moved ARCH_DMA_MINALIGN to include/linux/cache.h from slab.h (it > matches the asm/cache.h where most architectures defining this macro > place it). > > - Single body for __kmalloc_minalign() with an #ifdef. > > - Renamed the sg_dma_use_swiotlb() to sg_dma_is_swiotlb() (Robin's > suggestion). > > - Added acks/tested-by. > > Catalin Marinas (15): > mm/slab: Decouple ARCH_KMALLOC_MINALIGN from ARCH_DMA_MINALIGN > dma: Allow dma_get_cache_alignment() to be overridden by the arch code > mm/slab: Simplify create_kmalloc_cache() args and make it static > mm/slab: Limit kmalloc() minimum alignment to > dma_get_cache_alignment() > drivers/base: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN > drivers/gpu: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN > drivers/usb: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN > drivers/spi: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN > dm-crypt: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN > iio: core: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN > arm64: Allow kmalloc() caches aligned to the smaller cache_line_size() > dma-mapping: Force bouncing if the kmalloc() size is not > cache-line-aligned > iommu/dma: Force bouncing if the size is not cacheline-aligned > mm: slab: Reduce the kmalloc() minimum alignment if DMA bouncing > possible > arm64: Enable ARCH_WANT_KMALLOC_DMA_BOUNCE for arm64 > > Robin Murphy (2): > scatterlist: Add dedicated config for DMA flags > dma-mapping: Name SG DMA flag helpers consistently > > arch/arm64/Kconfig | 1 + > arch/arm64/include/asm/cache.h | 3 ++ > arch/arm64/mm/init.c | 7 +++- > drivers/base/devres.c | 6 ++-- > drivers/gpu/drm/drm_managed.c | 6 ++-- > drivers/iommu/Kconfig | 1 + > drivers/iommu/dma-iommu.c | 58 ++++++++++++++++++++++++-------- > drivers/iommu/iommu.c | 2 +- > drivers/md/dm-crypt.c | 2 +- > drivers/pci/Kconfig | 1 + > drivers/spi/spidev.c | 2 +- > drivers/usb/core/buffer.c | 8 ++--- > include/linux/cache.h | 6 ++++ > include/linux/dma-map-ops.h | 61 ++++++++++++++++++++++++++++++++++ > include/linux/dma-mapping.h | 5 ++- > include/linux/iio/iio.h | 2 +- > include/linux/scatterlist.h | 60 ++++++++++++++++++++++++++------- > include/linux/slab.h | 14 +++++--- > kernel/dma/Kconfig | 7 ++++ > kernel/dma/direct.c | 2 +- > kernel/dma/direct.h | 3 +- > mm/slab.c | 6 +--- > mm/slab.h | 5 ++- > mm/slab_common.c | 41 +++++++++++++++++------ > 24 files changed, 244 insertions(+), 65 deletions(-) >