Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp675120iog; Mon, 13 Jun 2022 10:22:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ux1TG4x0E31VwF+NQwjJIuX14394RmzyrUuh3J6rsq9pW4bsZoyQGYNE+zzqsubCtvPir8 X-Received: by 2002:a17:902:f149:b0:167:8569:ec00 with SMTP id d9-20020a170902f14900b001678569ec00mr34637plb.8.1655140940928; Mon, 13 Jun 2022 10:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655140940; cv=none; d=google.com; s=arc-20160816; b=zl0Oc+Yc8OVO1ACti2L9O+BNz4uBnmNTr8Neq9h+9TMGuu+Shfa+9oYnqRnCjqQCxo KR55ANIP9ggz/kjFq9gdhy7btMCQjE5dl+bh9cw8aACq+CkBWjJ5CAADuiEo9z/gt00N gOS0Id8Ujogg4F6j7E0/mo34RfACl+TdtyWJ5S0qoFN662hnp4Dp1ChXW4M/fhJCXj0a pQNI22PQViN/0V/PL0HytkDx4SsmFvgQUNSSjRynvm8T+8IKaYOzWgGAlRDGC2ztbgrS tQI7kOowPnt+00x4103qumcyXplWjtHSCO5fjr8zgVFtHLxGXgbWC7TZGN5UqBKSPddz B+3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=qIE0xwP1kuFNC2t5JxD7cYaMCl2XLZaK7Y4SfKIecsg=; b=SaOdX2HRDuRYYcGAm4hPOScHmZ5w6hnklH5e78sgWnkJuRaz/FuT/mv1dZQFQ1K1RK 3Z/RbeJHw+E3ZOsqKzFNjMPw05GWL8SXZ9OPuUTGanGhPdO130FAK3UIOyNu3kXXO0M+ 2+QFtwHvx72/98PVesSRjswAkgbJ3jxrIeQ/QV28PhlGvYsZG1PTAFoZYP3XE8rz4oTp iUxhgXVHXRVxXkfXaGZjREPjbqGaeGfbms3i1tSBrFaOpJyJnyC2TmpUtMPosQHzxOVx L+QMu2Yt23AWCTD4TEymgBUt4djzS53/vVx5z0/jS1zeWLnw2wq70toX7xXNMVDITyK7 tAew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b=JSj5kCpw; 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=NONE dis=NONE) header.from=gentwo.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 124-20020a630182000000b003fa63cec349si10055870pgb.832.2022.06.13.10.22.07; Mon, 13 Jun 2022 10:22:20 -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=@gentwo.de header.s=default header.b=JSj5kCpw; 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=NONE dis=NONE) header.from=gentwo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235776AbiFMQFZ (ORCPT + 99 others); Mon, 13 Jun 2022 12:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242635AbiFMQDE (ORCPT ); Mon, 13 Jun 2022 12:03:04 -0400 Received: from gentwo.de (gentwo.de [IPv6:2a02:c206:2048:5042::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FF3D19F044 for ; Mon, 13 Jun 2022 06:50:50 -0700 (PDT) Received: by gentwo.de (Postfix, from userid 1001) id 218AAB0038E; Mon, 13 Jun 2022 15:50:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.de; s=default; t=1655128246; bh=P+2Eu0qhpYq7wlVABAoxSztYDseAwAfN1SZ+KJbEPI0=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=JSj5kCpwzNiybmfkJ9cFZFwFT/DLgMR/bHnf/I5OvjlhgCZtoN5aO84Qy6tAlA4FH /Euln5mYy8576zUa1anqLY2ywdFNGWn3N55zp8/PA7ugxgkJVOWabwrB9/sjNvJCKY Eb6nNfkUuDajbXroIBpmrO6QTFdoxmJSxJqOlkyT2KzDP79KFVE8/1yFtcaeI2jPSk Bx2S6/7TWrv59Litco30Rdhnl/+2IEateCvBF1Co0JP/F04DFU8FWVGAWDBqkdYCJx j06wuSCw9JewarHKp2BFaS2DkO9VEcauh+lqC+3jJ3s7tV2hNMIo2X7GWRKKiQmbhW tjTanhk0kLyWg== Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 1F532B0034A; Mon, 13 Jun 2022 15:50:46 +0200 (CEST) Date: Mon, 13 Jun 2022 15:50:46 +0200 (CEST) From: Christoph Lameter To: Rongwei Wang cc: David Rientjes , songmuchun@bytedance.com, Hyeonggon Yoo <42.hyeyoo@gmail.com>, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, iamjoonsoo.kim@lge.com, penberg@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mm/slub: fix the race between validate_slab and slab_free In-Reply-To: <02298c0e-3293-9deb-f1ed-6d8862f7c349@linux.alibaba.com> Message-ID: References: <20220529081535.69275-1-rongwei.wang@linux.alibaba.com> <9794df4f-3ffe-4e99-0810-a1346b139ce8@linux.alibaba.com> <29723aaa-5e28-51d3-7f87-9edf0f7b9c33@linux.alibaba.com> <02298c0e-3293-9deb-f1ed-6d8862f7c349@linux.alibaba.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 Sat, 11 Jun 2022, Rongwei Wang wrote: > > Ok so the idea is to take the lock only if kmem_cache_debug. That looks > > ok. But it still adds a number of new branches etc to the free loop. > > > > Some performance tests would be useful. > Hi Christoph > > Thanks for your time! > Do you have some advice in benchmarks that need me to test? And I find that > hackbench and lkp was used frequently in mm/slub.c commits[1,2]. But I have no > idea how to use these two benchmarks test to cover the above changes. Can you > give some examples? Thanks very much! Hi Rongwei, Well run hackbench with an without the change. There are also synthetic benchmarks available at https://gentwo.org/christoph/slub/tests/ These measure the cycles that slab operations take. However, they are a bit old and I think Pekka may have a newer version of these patches. Greetings, Christoph