Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6313480rwd; Mon, 19 Jun 2023 05:43:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7NzZl/0TlgSPdJ76fVpBZFSC8RXjEZzvH+3myOfITdWkltK8dtTUA4FZTnfwIdesltEnG9 X-Received: by 2002:a05:6358:a5e:b0:12c:9964:2394 with SMTP id 30-20020a0563580a5e00b0012c99642394mr3373825rwb.7.1687178582226; Mon, 19 Jun 2023 05:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687178582; cv=none; d=google.com; s=arc-20160816; b=ksBhUyfn2c7raJLVksUKP1jc2jnFjDc2oJaGmSgV5I4cyU5qcNjqAdZMOhab9bTuAa xBfVNWGJiQY3qZOesnizv9+6TQMXg0/e1jq8u4TfEnH8Upo5yBCDqFXQ6RiMXzjHwXvU 0ZGeVXSIYWDdBC4xocVLmt67T9hkMygCd8zLAAtTWMFmT2TUz8SUvAnInroQDAw+iPmq KogSYkpQ60YQpplr6PY1zIL4TTofd5CrYdXSYWUqEOMn/KIqTJzP8v/4/7s11GOOFY5J oxrKNL6TDDhqnXkGQTBpgkyjgJQjQkHJdg/vE8m+H0Wgt6ytDH16zfuXyj2NMQr6Jjwh mkTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=utC0O0PqIbYjKNo0xAhkO8uA0JOoM6zmPcFMdSpz7YU=; b=z77EsOLGeBVcPnWKwz4KwGcaA/TUdXe0ECVbOVDnLD/qxgsSVdcHmjvfMRG7eb/Nza 2WrDxNOd8KwbUSlqmfYmGKHhKyL3JH76XqfUvMVlHnwgR+XQBbO93oHUmAsiOjGs8Md7 dPGFk3pPo1IXe+6X6lJ4LC9zOBbYyEdO8sJGjgHDkNYWPIdQBqFj/Q4FKl2ELjF/GjBN 6Rdp/E5ZBsjcr1BEYcxhVv2K+vxLYwrfvuOlPUbsfujMOfEICj4HlqCfYcp1S5Rf2Rf3 mqwd/65NZgDhnbKpumx8NyU9cWPdoTlIReBYf4gHPEu0DaoOMVb1twbwTyCh9YVLfKGx TRbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020aa79a41000000b0063b64166faesi20971414pfj.157.2023.06.19.05.42.50; Mon, 19 Jun 2023 05:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjFSMQs (ORCPT + 99 others); Mon, 19 Jun 2023 08:16:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjFSMQr (ORCPT ); Mon, 19 Jun 2023 08:16:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3915A11D; Mon, 19 Jun 2023 05:16:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BED6E60BC0; Mon, 19 Jun 2023 12:16:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03282C433C0; Mon, 19 Jun 2023 12:16:43 +0000 (UTC) Date: Mon, 19 Jun 2023 13:16:41 +0100 From: Catalin Marinas To: Stephen Rothwell Cc: Vlastimil Babka , Andrew Morton , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: manual merge of the slab tree with the mm tree Message-ID: References: <20230619140330.28437ac3@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230619140330.28437ac3@canb.auug.org.au> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 19, 2023 at 02:03:30PM +1000, Stephen Rothwell wrote: > diff --cc mm/slab_common.c > index 43c008165f56,90ecaface410..000000000000 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@@ -892,24 -876,17 +890,24 @@@ new_kmalloc_cache(int idx, enum kmalloc > flags |= SLAB_CACHE_DMA; > } > > + if (minalign > ARCH_KMALLOC_MINALIGN) { > + aligned_size = ALIGN(aligned_size, minalign); > + aligned_idx = __kmalloc_index(aligned_size, false); > + } > + > + /* > + * If CONFIG_MEMCG_KMEM is enabled, disable cache merging for > + * KMALLOC_NORMAL caches. > + */ > + if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_NORMAL)) > + flags |= SLAB_NO_MERGE; > + > - kmalloc_caches[type][idx] = create_kmalloc_cache( > - kmalloc_info[idx].name[type], > - kmalloc_info[idx].size, flags, 0, > - kmalloc_info[idx].size); > + if (!kmalloc_caches[type][aligned_idx]) > + kmalloc_caches[type][aligned_idx] = create_kmalloc_cache( > + kmalloc_info[aligned_idx].name[type], > + aligned_size, flags); > + if (idx != aligned_idx) > + kmalloc_caches[type][idx] = kmalloc_caches[type][aligned_idx]; > - > - /* > - * If CONFIG_MEMCG_KMEM is enabled, disable cache merging for > - * KMALLOC_NORMAL caches. > - */ > - if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_NORMAL)) > - kmalloc_caches[type][idx]->refcount = -1; > } > > /* Thanks Stephen. The resolution looks fine to me. -- Catalin