Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2110694iof; Tue, 7 Jun 2022 20:05:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsTrx/GONYqFUHOpSpjb5FakIyuDMDUT3D/SkVZPTUzdAlKqdIn69QivQOLxvbCl9wqdqt X-Received: by 2002:a17:903:22cb:b0:167:992f:60c3 with SMTP id y11-20020a17090322cb00b00167992f60c3mr5014147plg.59.1654657526106; Tue, 07 Jun 2022 20:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654657526; cv=none; d=google.com; s=arc-20160816; b=APMwXx4S266VixNR3yeJRmHcaaOLJw6Hg+QRzdCc/JFkqTapuwZPMgLXbavspEQz/6 1oKKDB+hlPZpD8Gj0CbqWNlP+lTRUvBtXG070U19TFNJw3pRp4wBBTVxC9uXB35tSHxT VlkLTMSnoJYQAoikWOTBg6qROZNxSpDdzbIfJFpAdYoJX6VsEEqEufN4XB4rejlJNgNM x1S00iAXMk5txMAFVX0DQwo6WkRcKizaAuWzPvR97m9kiXs4/LK4g86xNi1raD2oQZqT FZ241r6muiQ4WL1wn1aOg73iXt5lu1X7K8bfdSytUOtjUCo0qNjIIGFc0Ir5jX8I+lZ2 YK5A== 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=/15Jtn/l6rflU2k3fwtc3B718k5z91qYrofnha1OCHI=; b=gaFsvbsumxFzmZOCM/auspDfEOOI5tYyHH+pJkIgxSCxoBOpLlOubJ5fS29Xxddcp7 b6cCejCfgl8nuvtRV6Z4TbYdGFfQsqWsrTpU8cN5s4rCTOXh82toXq7Vm7vdVcmOPUOb hGGCgZ+Dq1WAUueZ9plcuuGdeBAY8d+jA1qcOZsHG+6Yeqyp9HROR2Sbo31CYGvc0YZf hKj0WniQ8mSdUrJC18G2U0dikzIdPB97V+I5slfIxWZ7nUwJ1Ag7P9LAfCtRrCE+73Aj Hc3C4kxprT4zkVk36fI3oB0AsA3imxoifDanLpa1pj067k/v97rCHXFc0Dw8Z2taqH8F Z9TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b=wf63nbTf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mq18-20020a17090b381200b001d99fab8c25si28943571pjb.10.2022.06.07.20.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:05:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b=wf63nbTf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gentwo.de Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 934FE1AD5A1; Tue, 7 Jun 2022 19:12:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243543AbiFGMOw (ORCPT + 99 others); Tue, 7 Jun 2022 08:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237872AbiFGMOu (ORCPT ); Tue, 7 Jun 2022 08:14:50 -0400 Received: from gentwo.de (gentwo.de [IPv6:2a02:c206:2048:5042::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8FB4C0E0E for ; Tue, 7 Jun 2022 05:14:47 -0700 (PDT) Received: by gentwo.de (Postfix, from userid 1001) id C7CEBB0012F; Tue, 7 Jun 2022 14:14:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.de; s=default; t=1654604085; bh=/15Jtn/l6rflU2k3fwtc3B718k5z91qYrofnha1OCHI=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=wf63nbTf3C53rPmwuG1tCmvb5P2bJo07dXmf3zRdMrTb7TwuGydkqufLv+tVMcya9 AQkGwZ4TwrUqQYhUJJcjXVlMCTouUt6F3TuytbH68ymm55CCZffOW1PgyD+sl96XPu bAgSXiAGZlxSAoyawlxYpncvWYJyxheu3p5M5DKBwEWYRahYstzXtLgZNXjQ7qonr6 /ty98DDgFbbLPKCpSWCUIkNYP3TmnZf8ESSOkkivXRKR/iR+7nsm3W4PjsNFgoZTfd Dr7q8mVlfhyIehMWZpJ6Ty+AqZT7n90thZbDj50dqmttKFYc0xR8igvE14uzCXxFu0 fRliG+LFUciBg== Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id C39A7B00060; Tue, 7 Jun 2022 14:14:45 +0200 (CEST) Date: Tue, 7 Jun 2022 14:14:45 +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: <9794df4f-3ffe-4e99-0810-a1346b139ce8@linux.alibaba.com> Message-ID: References: <20220529081535.69275-1-rongwei.wang@linux.alibaba.com> <9794df4f-3ffe-4e99-0810-a1346b139ce8@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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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, 3 Jun 2022, Rongwei Wang wrote: > 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! Well validate_slab() is rarely used and should not cause the hot paths to incur performance penalties. Fix it in the validation logic somehow? Or document the issue and warn that validation may not be correct if there are current operations on the slab being validated.