Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp826650imm; Wed, 10 Oct 2018 05:05:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV61c69pz31M33MrlXS/p2Di9/WefdgmHZpwP+v//35so81TVD4Wyhfgtu0wf9e22lVjChswp X-Received: by 2002:a17:902:930b:: with SMTP id bc11-v6mr16995504plb.101.1539173105257; Wed, 10 Oct 2018 05:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539173105; cv=none; d=google.com; s=arc-20160816; b=W48dKWjYC3316lKRq1dLfQeQtX3bx5c8Sk3CMt1DTgR6vG0YiIcNOu6f4wsAyNGyKN Gcbm4V16r/I+E4wSdguSpryrG9n0BerzoERQwyzoYcaXxrJB9EdhGLYN6SqFhfvgZuX/ ImD0pFJ25+HhLBKcw1BsFknvzu5uaSBuCYaIEqZSn+QEOTv9QgWFZmME6QyW7DM3zSR1 9fxAi9uG+7gw8/FuAyLFRagQWAMST9HL0hGc5lQ1T5HzkeByC/qDfiacOLKGjJpdcjx5 KMAfkMIzhtvdFiSm9QrotDxmjoZel4CI5UUk7+UEEyXt5nmLd5M257FCYgI4AYGXN3/c Vy8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=p7+X8otvLyNysLZLwNOGGxeOMQitinQooY43JX83xs0=; b=tF5mQEQcpKI5a6aBOzci1zKWPNtDg066sXBNexL432FSXJn0PPLRiCkG1PXZNI/7u7 QIo8r2GVmTB9KOHOrGKBXxjJ2ykYHmFPmQaMTw7UbzFLzRc8xYRqy3amkV7DeMvpP+2f gm+7s+euWD5HlQpexkQFquLEAFimZAgdf6MkJgi0GmjV3GwBV4UTFS20zJWtxkHEt8VW dHbBN0qdna0v6NL4Qb6jxS3FZAzI9qgVkJ/72+u0xyJ1cmtJJJRYp8/jTqgg5z1ukkyw OWWLgydiOGbLbGPJYg8ywbGPuD+xJfftT7k6+a88fEZ+oLdqtDKrYveNYyOg+wEF5RVr gcjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si24241053pll.35.2018.10.10.05.04.48; Wed, 10 Oct 2018 05:05:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbeJJT0Q (ORCPT + 99 others); Wed, 10 Oct 2018 15:26:16 -0400 Received: from ozlabs.org ([203.11.71.1]:36195 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbeJJT0Q (ORCPT ); Wed, 10 Oct 2018 15:26:16 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42VXnp63kdz9s7W; Wed, 10 Oct 2018 23:04:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Mike Rapoport , linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Chris Zankel , Geert Uytterhoeven , Guan Xuetao , Ingo Molnar , Matt Turner , Michal Hocko , Michal Simek , Paul Burton , Richard Weinberger , Russell King , Thomas Gleixner , Tony Luck , linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-um@lists.infradead.org, Mike Rapoport Subject: Re: [PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES In-Reply-To: <1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com> Date: Wed, 10 Oct 2018 23:04:12 +1100 Message-ID: <87o9c22ekj.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mike Rapoport writes: > When a memblock allocation APIs are called with align = 0, the alignment is > implicitly set to SMP_CACHE_BYTES. > > Replace all such uses of memblock APIs with the 'align' parameter explicitly > set to SMP_CACHE_BYTES and stop implicit alignment assignment in the > memblock internal allocation functions. > > For the case when memblock APIs are used via helper functions, e.g. like > iommu_arena_new_node() in Alpha, the helper functions were detected with > Coccinelle's help and then manually examined and updated where appropriate. > > The direct memblock APIs users were updated using the semantic patch below: > > @@ > expression size, min_addr, max_addr, nid; > @@ > ( > | > - memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid) > + memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr, > nid) > | > - memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid) > + memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr, > nid) > | > - memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid) > + memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid) > | > - memblock_alloc(size, 0) > + memblock_alloc(size, SMP_CACHE_BYTES) > | > - memblock_alloc_raw(size, 0) > + memblock_alloc_raw(size, SMP_CACHE_BYTES) > | > - memblock_alloc_from(size, 0, min_addr) > + memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr) > | > - memblock_alloc_nopanic(size, 0) > + memblock_alloc_nopanic(size, SMP_CACHE_BYTES) > | > - memblock_alloc_low(size, 0) > + memblock_alloc_low(size, SMP_CACHE_BYTES) > | > - memblock_alloc_low_nopanic(size, 0) > + memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES) > | > - memblock_alloc_from_nopanic(size, 0, min_addr) > + memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr) > | > - memblock_alloc_node(size, 0, nid) > + memblock_alloc_node(size, SMP_CACHE_BYTES, nid) > ) > > Suggested-by: Michal Hocko > Signed-off-by: Mike Rapoport > --- ... > arch/powerpc/kernel/pci_32.c | 3 ++- > arch/powerpc/lib/alloc.c | 2 +- > arch/powerpc/mm/mmu_context_nohash.c | 7 +++--- > arch/powerpc/platforms/powermac/nvram.c | 2 +- > arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++--- > arch/powerpc/sysdev/msi_bitmap.c | 2 +- The powerpc changes all look fine. I'm not quite clear on how SMP_CACHE_BYTES is getting included. I think it's: memblock.h -> mm.h -> mmzone.h -> cache.h So that's probably fine. Acked-by: Michael Ellerman (powerpc) cheers