Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7657083ioo; Fri, 3 Jun 2022 10:44:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwJadjXDfkaqzIeX/u9oQTTrq/2lb4cOYZWHiU5rA0ZMVeQ4mrFu12LcmgaIGkZbM5yzQN X-Received: by 2002:a05:6402:908:b0:428:11f5:509d with SMTP id g8-20020a056402090800b0042811f5509dmr12061549edz.253.1654278265682; Fri, 03 Jun 2022 10:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654278265; cv=none; d=google.com; s=arc-20160816; b=fRwNslKZz8q3v4gfKrfh0my67kGvhAS2WtE/1YXF19WIUXJpriys7bhgle0qj+GKdJ Au+cWaHWbVyigy8RSwuXxG/P99VQViKjURYc7rAavNTvteqnttrQiRX6iWPCS/cpctDw x1kk+Di3fls2D2X00a3C1/xjvuJ67mJmpba9VyakmCswkA/1Y5SR0ZAP+6Cqo6dGtV2q 2GEXmeV7t8cxFffElV0ZZGHlHqJ6RAixRnDGUVeMdxogaloM2XFFBjmH+S4tLDg0f9Wn WOTnwLAiZZ5EJJcLmQmumjYrZ72lu3Ckj8EfpBWOwMWsu/0rOGpbR0IUmCT8piBsV33N z2+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=AUUq+xl+4OfBCij5n4DFUvfpfP8O6E7ZpLNLQXrSkIk=; b=hsLo1PEGdeqlYcUk94EGyeeXwVgGou3uNWC/j/LiLd0dX8Ew1Y8D6JCpi9Ur6y5N42 Y5oe+09ZFreIfxwfiPPlrXye4wCERXS91m4dR/TXFw9w6y3WKUJ4ZI4i0bVEdSo9MCH3 X/RX/9BVaWsm77ZX5cogLmEVyBDVWfXbCfNGpl0SEzW0mMYbHRLGPEx3P5mNs0wuiLhV TOrZaFFjqkwTQ2DdxoKWqdbtbpHG547fsnCY+4mSOfeF0ByyfQ2zFQeRieizIvLOsNYf PqWfiXZD1Bpxup7Prx96h1RyqPKxCHX9POEaweH7FD6zl0OZ1IjGaymd8Lfb4xSrSO0d APzQ== 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=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr12-20020a170907720c00b006fea9b7120bsi6597821ejc.763.2022.06.03.10.43.58; Fri, 03 Jun 2022 10:44:25 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbiFCDfk (ORCPT + 99 others); Thu, 2 Jun 2022 23:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbiFCDfj (ORCPT ); Thu, 2 Jun 2022 23:35:39 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1153E36E25 for ; Thu, 2 Jun 2022 20:35:37 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=rongwei.wang@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VFDf1ro_1654227332; Received: from 192.168.31.179(mailfrom:rongwei.wang@linux.alibaba.com fp:SMTPD_---0VFDf1ro_1654227332) by smtp.aliyun-inc.com(127.0.0.1); Fri, 03 Jun 2022 11:35:33 +0800 Message-ID: <9794df4f-3ffe-4e99-0810-a1346b139ce8@linux.alibaba.com> Date: Fri, 3 Jun 2022 11:35:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:101.0) Gecko/20100101 Thunderbird/101.0 Subject: Re: [PATCH 1/3] mm/slub: fix the race between validate_slab and slab_free Content-Language: en-US To: Christoph Lameter , David Rientjes , songmuchun@bytedance.com, Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: 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 References: <20220529081535.69275-1-rongwei.wang@linux.alibaba.com> From: Rongwei Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 Hi, Christoph, David, Muchun and Hyeonggon Thanks for your time. Recently, I am also find other ways to solve this. That case was provided by Muchun is useful (Thanks Muchun!). Indeed, it seems that use n->list_lock here is unwise. Actually, I'm not sure if you recognize the existence of such race? If all agrees this race, then the next question may be: do we want to solve this problem? or as David said, it would be better to deprecate validate attribute directly. I have no idea about it, hope to rely on your experience. In fact, I mainly want to collect your views on whether or how to fix this bug here. Thanks! Thanks again for your time:). -wrw On 6/2/22 11:14 PM, Christoph Lameter wrote: > On Mon, 30 May 2022, David Rientjes wrote: > >>> Unconditionally taking n->list_lock will degrade performance. >> >> This is a good point, it would be useful to gather some benchmarks for >> workloads that are known to thrash some caches and would hit this path >> such as netperf TCP_RR. > > Its obvious that adding new spinlocks to some of the hottest functions in > the kernel will degrade performance. This goes against the basic design of > these functions to be as efficient as possible.