Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3545057pxp; Tue, 8 Mar 2022 17:06:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcdi91dRZBGb4ue4ayBkWpHNzD2aeZtrdf0aLt3X1hp5kpssYKpHCHMdu9LMnNo7R1M2lL X-Received: by 2002:a17:90b:1811:b0:1bf:582e:443c with SMTP id lw17-20020a17090b181100b001bf582e443cmr7798878pjb.0.1646787960326; Tue, 08 Mar 2022 17:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646787960; cv=none; d=google.com; s=arc-20160816; b=KIYgk9FcamSuEy/MgAYgJ64ierFwNKMWDrUP62txwnz+d4tFuG/zF6GugnhMW9BgVd 8a2dmwT/TtNeRMPciNOJT55s2a7TeE3uL0jBu+4ZEMRrwnyoCnZDsnAgFs/pCHiBe1Hd yxYtEBNDuuO+AOX/poRUMlvAWQfxAUqOHwiAnGZawVBMHUzNeTH5EU1h5PbknLva8qzG WC/oXzyqNvXWEqClDxpvdmP/A8JCv9VdyQ2yh5v0DGwLaRy0KntesriXV1l+CiEdWbsu +9FFnzUBittmWb2gMYf6lH54Z0jMgwNYZOeEm3glQ8pKNoiIOckOeXmqHBeLOutB3n5Z ANcA== 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:dkim-signature:date; bh=5tjFk/Dw764Ls2/rcpPUJ5xUi4eZvU9dCCyj5nTruvU=; b=BC5nLcCw4vQPt9nXTaje0Io7nVHrhdllPH1nbsGLGCetn8gexhS7XtpiUKKFqhtCdV fYem7aE/FDn5CwVD17RZQgQ3KQslhTyM8COVx0lUIvf6zc684DfgMLZNWvJWVwtUubqF rgGbUm750fEZLtB4RJHQsMiLr5euvyDBlQu1iKgfhvjAWxuE4t3Dit/2NDRAh4TAyvli Oj3nMeurJMWgYRmm2WONsrmvTDNfgxz+aB2/8KxStKpdBdWDPzxCnL4X/iuuQgVTb/6n t2mF09yw86nLa0LZSeqA0rH8CfC/zBvH7F/ieCaEZLdMTNCExOjYT5MrVk2+RRpAGEwt 07mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=r4kEFYEK; 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=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x2-20020a170902ec8200b00151cd151044si558536plg.270.2022.03.08.17.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:06:00 -0800 (PST) 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=@linux.dev header.s=key1 header.b=r4kEFYEK; 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=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8E11B2E2B; Tue, 8 Mar 2022 16:11:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238869AbiCHFC6 (ORCPT + 99 others); Tue, 8 Mar 2022 00:02:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbiCHFC4 (ORCPT ); Tue, 8 Mar 2022 00:02:56 -0500 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537CB33EA1 for ; Mon, 7 Mar 2022 21:02:01 -0800 (PST) Date: Mon, 7 Mar 2022 21:01:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1646715719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5tjFk/Dw764Ls2/rcpPUJ5xUi4eZvU9dCCyj5nTruvU=; b=r4kEFYEK9oik/rlloyN04+OvtWokBLsP8excAZk/EXHJG4PWktet51F1ifiJLdFEJgsRx8 ZHe7uAJcZU1X+lv4XbGXIgLUwxoV4zJZEkf7EYkzwVt8QICyG33Uiv4VYWbH4eNBWveA9F 4Hau37Oq3BIdWC1jPN7yh7yrXYC7dr4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: linux-mm@kvack.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Marco Elver , Matthew WilCox , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] mm/slub: refactor deactivate_slab() Message-ID: References: <20220307074057.902222-1-42.hyeyoo@gmail.com> <20220307074057.902222-3-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220307074057.902222-3-42.hyeyoo@gmail.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev 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 Mon, Mar 07, 2022 at 07:40:56AM +0000, Hyeonggon Yoo wrote: > Simplify deactivate_slab() by unlocking n->list_lock and retrying > cmpxchg_double() when cmpxchg_double() fails, and perform > add_{partial,full} only when it succeed. > > Releasing and taking n->list_lock again here is not harmful as SLUB > avoids deactivating slabs as much as possible. > > [ vbabka@suse.cz: perform add_{partial,full} when cmpxchg_double() > succeed. > > count deactivating full slabs even if debugging flag is not set. ] > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Roman Gushchin Thanks!