Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1316741rwi; Fri, 14 Oct 2022 16:55:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ar2uw5SLZVViiCFzYnKb/ao3FswVVAKUFsFce5Trdj0VHMoZQ5iL8oTjMYw40PfKtzApH X-Received: by 2002:a17:90b:1c87:b0:20a:e485:4e21 with SMTP id oo7-20020a17090b1c8700b0020ae4854e21mr441800pjb.194.1665791722149; Fri, 14 Oct 2022 16:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665791722; cv=none; d=google.com; s=arc-20160816; b=sclmyA8VvyL+JDlChJyuzffqLXJh1QkO3qMefrZhKVFQzvFUhRkoYFYYSSTqvgydPx C2u4EODbM2h3ww39357MuL+HF6NZ9bYu9X/wYY/JT7vJOYaegV+IiLTSlm8pm1OtSFzt p1Rx84dHASaI+EuE6uDqfFAkX1Gpt+YnL8UAequ6kkXreRBk9qX2QWUbeqJqs0U4hC0f ocEfewcIl8yTM+schmO45BLKRnvpz2YAzt7AqoMVSj7cpETa9j6OVIS/H4/AxsDKdmE/ grfpbXtd1kJn25uP4EV4pMimVXv9KEMNsraCc5xtvLeMaQZFn3jjI2wXct2ipRnpQdUv pqzw== 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:dkim-signature; bh=9QZI/RqGnedzhVKRkdDMdjD3VHFiD/WtMgGFjHrwV9E=; b=IBwKRUHPLEkEvSXflc23Zxjl9xCoZiVI7oXDRcf/O3ZIqIkS8azqMWXtv1jOJbih+G 0wNPUj8A4dMTdvoOUgMHIGGoosMGsUCvuODVGc0pLTDnVuMf3cfUXUC2MqJPJaeShuZd iqz57mexS6XsIqs3tFzpaCpi4kRixRvApGmPmZivlTg2qW/7/G6aJgQDASMhUu9fgKjF uLgcM8/2PESGHE0hUGqWypLnugILPrAkhD5+AcQwLjYP8NmFwVk0jY95Cu/DbeiKrcvK Sf/cz63f3Rr0HvV3CjFXbs6Er/v5euyUt9te0ccZdbfTl1XrPrDr09yieRd5klPx/Z8S KF1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KnSdxaaG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a170902ebcc00b0017f57787a5dsi4421273plg.223.2022.10.14.16.55.09; Fri, 14 Oct 2022 16:55:22 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KnSdxaaG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbiJNXs5 (ORCPT + 99 others); Fri, 14 Oct 2022 19:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbiJNXsv (ORCPT ); Fri, 14 Oct 2022 19:48:51 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA9A8FE923 for ; Fri, 14 Oct 2022 16:48:50 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id h185so5597525pgc.10 for ; Fri, 14 Oct 2022 16:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9QZI/RqGnedzhVKRkdDMdjD3VHFiD/WtMgGFjHrwV9E=; b=KnSdxaaGLSvkI99TvIbrbSUUvmAOAxfEqbL+31ZrkN1Gfp0YkJGkOui74tPIAh0NgT LLq/dGPuaCoO9WLeNv+a2y/xtSHpzCWI36EJMYq6k3DGpgsukzAzHZK+QrLLcYrxK8/W OeSrP/U8trz4hvqKw+cb/WMsaum9QXzDw92B9Iut+j5+V3qaYmq2hqn9y1wx7r0kQVl5 lDvS+o91ObQJ35vlSjpnel2jF8H3mZUFUj0o7cljURAnvW0vg06YfDJPb4XkksJYwsQ8 21AK2tB0bCX6iYQQGTVQ/mR7SSFEZYfOfUBp6wuM6q2O9h9bmMBfNLlBh9hs6usglABE n9gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9QZI/RqGnedzhVKRkdDMdjD3VHFiD/WtMgGFjHrwV9E=; b=D9mQY7cneoNre/RkMyPcnJZ9RRY0OO9LOae+e5RhFXqr78M0fVb2ZlLKTt0vCRDIe8 KWkj6w63wZSQ3LK6psV+t7Av04RxptkCYXi+5KXdCtzXNNwhP1O9v5lS7DldE1N//XLN aLkTWNY4lpr88NcKv8jAYCTeSahLMHgQjxbXXYEq7tMjcSULuGNHhgCuiyVWQVXBaWGm xe4nTRg00464VJYj3Ddwi3Yd3FDt7lV1qkSvFpY+cX+Jl1HOB+xuVspVR/45fihzCwix SeBD1Ny2zYE95c3JojntnGMhB5TjgLE+tpNpc1paPV4y5DTelmsprdnmbUY8NfmO0v19 EUsg== X-Gm-Message-State: ACrzQf1HtFOXMNqc7+PaBVQqXiPGL2d6tppJAIemlGeUNEl8h2d5WAAH JmqZ2EjOhb+Iwq7Dy7+onfY= X-Received: by 2002:a63:91c9:0:b0:459:ca3:7245 with SMTP id l192-20020a6391c9000000b004590ca37245mr337385pge.94.1665791329912; Fri, 14 Oct 2022 16:48:49 -0700 (PDT) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id 73-20020a63064c000000b0043c732e1536sm1934836pgg.45.2022.10.14.16.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 16:48:48 -0700 (PDT) Date: Sat, 15 Oct 2022 08:48:43 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Guenter Roeck Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 10/17] mm/slab: kmalloc: pass requests larger than order-1 page to page allocator Message-ID: References: <20220817101826.236819-1-42.hyeyoo@gmail.com> <20220817101826.236819-11-42.hyeyoo@gmail.com> <20221014205818.GA1428667@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221014205818.GA1428667@roeck-us.net> X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Fri, Oct 14, 2022 at 01:58:18PM -0700, Guenter Roeck wrote: > Hi, > > On Wed, Aug 17, 2022 at 07:18:19PM +0900, Hyeonggon Yoo wrote: > > There is not much benefit for serving large objects in kmalloc(). > > Let's pass large requests to page allocator like SLUB for better > > maintenance of common code. > > > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Reviewed-by: Vlastimil Babka > > --- > > This patch results in a WARNING backtrace in all mips and sparc64 > emulations. > > ------------[ cut here ]------------ > WARNING: CPU: 0 PID: 0 at mm/slab_common.c:729 kmalloc_slab+0xc0/0xdc > Modules linked in: > CPU: 0 PID: 0 Comm: swapper Not tainted 6.0.0-11990-g9c9155a3509a #1 > Stack : ffffffff 801b2a18 80dd0000 00000004 00000000 00000000 81023cd4 00000000 > 81040000 811a9930 81040000 8104a628 81101833 00000001 81023c78 00000000 > 00000000 00000000 80f5d858 81023b98 00000001 00000023 00000000 ffffffff > 00000000 00000064 00000002 81040000 81040000 00000001 80f5d858 000002d9 > 00000000 00000000 80000000 80002000 00000000 00000000 00000000 00000000 > ... > Call Trace: > [<8010a2bc>] show_stack+0x38/0x118 > [<80cf5f7c>] dump_stack_lvl+0xac/0x104 > [<80130d7c>] __warn+0xe0/0x224 > [<80cdba5c>] warn_slowpath_fmt+0x64/0xb8 > [<8028c058>] kmalloc_slab+0xc0/0xdc > > irq event stamp: 0 > hardirqs last enabled at (0): [<00000000>] 0x0 > hardirqs last disabled at (0): [<00000000>] 0x0 > softirqs last enabled at (0): [<00000000>] 0x0 > softirqs last disabled at (0): [<00000000>] 0x0 > ---[ end trace 0000000000000000 ]--- > > Guenter Hi. Thank you so much for this report! Hmm so SLAB tries to find kmalloc cache for freelist index array using kmalloc_slab() directly, and it becomes problematic when size of the array is larger than PAGE_SIZE * 2. Will send a fix soon. -- Thanks, Hyeonggon