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 7C3C5C433EF for ; Tue, 14 Jun 2022 02:38:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE3918D0200; Mon, 13 Jun 2022 22:38:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C928A8D01EE; Mon, 13 Jun 2022 22:38:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5B7E8D0200; Mon, 13 Jun 2022 22:38:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A793D8D01EE for ; Mon, 13 Jun 2022 22:38:12 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 77B79121190 for ; Tue, 14 Jun 2022 02:38:12 +0000 (UTC) X-FDA: 79575282024.03.8C9E7F2 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf11.hostedemail.com (Postfix) with ESMTP id 2DB7540088 for ; Tue, 14 Jun 2022 02:38:09 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=rongwei.wang@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VGLIXr6_1655174282; Received: from 30.240.98.139(mailfrom:rongwei.wang@linux.alibaba.com fp:SMTPD_---0VGLIXr6_1655174282) by smtp.aliyun-inc.com; Tue, 14 Jun 2022 10:38:03 +0800 Message-ID: Date: Tue, 14 Jun 2022 10:38:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: [PATCH 1/3] mm/slub: fix the race between validate_slab and slab_free Content-Language: en-US To: Christoph Lameter , penberg@kernel.org 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, linux-mm@kvack.org, linux-kernel@vger.kernel.org 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> From: Rongwei Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655174292; a=rsa-sha256; cv=none; b=QzhicEhLFuZpTuZ/k8tVjQekmkuXoVRsGOo9vwPvBm1M37EJR5dzIYJeuuUI+dmnT6Wc+M 61iIFqo4sO+Z+qzFgMvnHWEiCFuX/UcK8GgxUP1lOn3/J/R25CCtaT4bvilaKSRVqxWmpe jAUdMpgVoYrgVINefjVsdMFtGhrbOhI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf11.hostedemail.com: domain of rongwei.wang@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=rongwei.wang@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655174292; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lNkdvs4HUl/e+RqqocIcgcUptQZO39VG19AdH897D/Y=; b=P2JngSQyT6HDGYLxr0qU3bjy4fzMNjZnO9Ir1p/6mir1Cx1md9TvD/4NlF621hjZP1hDrX 2SyIX08goBZ1bwkWmX7lsYNqUY/fsOhr2UvC39CNhs20jF6JoPhu8J2Hnb8ZTN4HQjXzpl tKij7ljQd7RgjCLkmUFNaDSbKQnaE4E= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 2DB7540088 X-Stat-Signature: 1meanwdpo8tbyyrrsy7i5e5honmxjmob Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf11.hostedemail.com: domain of rongwei.wang@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=rongwei.wang@linux.alibaba.com X-Rspam-User: X-HE-Tag: 1655174289-753172 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: On 6/13/22 9:50 PM, Christoph Lameter wrote: > 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. OK > > There are also synthetic benchmarks available at > https://gentwo.org/christoph/slub/tests/ That's great, thanks very much! > > 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