Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1197587rwi; Wed, 26 Oct 2022 12:00:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sHsB/yTF6Bk77jZXSnPMBicfud38iAumXAlFiOl+pXiLwP4CTWmO5VizBiWhu3hiGSdi2 X-Received: by 2002:a17:902:ec8e:b0:186:de89:7f66 with SMTP id x14-20020a170902ec8e00b00186de897f66mr3969278plg.160.1666810854452; Wed, 26 Oct 2022 12:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666810854; cv=none; d=google.com; s=arc-20160816; b=h9CW2s/6G5lF+YrdOl5ixmm6aal5H916fkNrdWl5GzE7YpjrGYFfU2jQIIC59pSLZo xtaTOmwvb+NAbYhusvvvcEU0jx7Ewx9ps8HRhbtNAsovZ7ZechrqF3lFAqmG9mHvhR82 OhTQxEp9MxcUMbw/E4lHL6eBri2Yc2T4WpiUCggx8Wm2flVET3jHDEkrQA1uVsGPMVtM um7OH5sN/G25c20f6mbAODMfuJBCuxtu7n/4RCWBsFfRMtBK7psNFLL3tQfmnAhpGXzp MvYTuArCxpUFhXtSFZ3SVa8soDyMO/kmMIP0b/J64Zqw1Ag8NANgR2zkbNUOth0EbqD3 sLBA== 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:date:dkim-signature; bh=c14ywI1xdXZdWoFtZUGaNlQ7OSW7CsbDv0TnLHcpulI=; b=r1nCWA2629SqDhpM2fs27Zbou8hEDEKfhcocxLL7geBNbetsSrKrhU9luB/zOXYgLp oBySdnL2nypKBeCxQoRRvKILLlFIIALn23gRHSYeGMV+xSqFUUk/wW+dOSQf8xuuSumA XIC1t27ECY0vYxNh/hX0CP2tn7EmS0VRLYyFm3mT1Yh4/hHOa4qizsnfLHj2swiXD0e/ nmx4ENN7PZpgkzzqJ5FmnjpN/ogJ4e23NRivUi4B0hxdVt5VQmlGEjc9Nl0gE8+lWB7s ZRSUoECcgs5FTRhSGQICg3ou/iOqcGAXuM/d0mACJzlW/ZUZ2R1Ze23btRXYPxCiLdJy XxFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GP3Uy3es; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a17090acf8400b001fd9be4fb6csi3319546pju.39.2022.10.26.12.00.42; Wed, 26 Oct 2022 12:00:54 -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=@alien8.de header.s=dkim header.b=GP3Uy3es; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234315AbiJZSb3 (ORCPT + 99 others); Wed, 26 Oct 2022 14:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234502AbiJZSbJ (ORCPT ); Wed, 26 Oct 2022 14:31:09 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80C0289906; Wed, 26 Oct 2022 11:30:09 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7b8329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7b8:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C6C571EC06A7; Wed, 26 Oct 2022 20:29:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666808995; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=c14ywI1xdXZdWoFtZUGaNlQ7OSW7CsbDv0TnLHcpulI=; b=GP3Uy3esNFrgCaYo+T1RfJ2EKCwPdigLmou+msv7WmmkDBsbwtQSQ7a5koSzq2kn4shbcV OtlR1SrKs+9Fwr6HSDaZ1ABzy/oMdf8Em8tK43Ci4Xbsc2pppNRIoGHZe3JQT206xp/1e2 k5pLcNt0SNIC7naWtPQ3tWkZbTVpUXo= Date: Wed, 26 Oct 2022 20:29:51 +0200 From: Borislav Petkov To: Yazen Ghannam Cc: Greg KH , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, tony.luck@intel.com, x86@kernel.org, Smita.KoralahalliChannabasappa@amd.com, mpatocka@redhat.com Subject: Re: [PATCH] x86/MCE/AMD: Decrement threshold_bank refcount when removing threshold blocks Message-ID: References: <20220614174346.3648305-1-yazen.ghannam@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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_NONE,SPF_PASS, URIBL_BLOCKED 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 Wed, Oct 26, 2022 at 03:39:15PM +0000, Yazen Ghannam wrote: > What's the issue with my original patch? Do you see it? > @@ -1258,10 +1258,10 @@ static void __threshold_remove_blocks(struct threshold_bank *b) > struct threshold_block *pos = NULL; > struct threshold_block *tmp = NULL; > > - kobject_del(b->kobj); > + kobject_put(b->kobj); > > list_for_each_entry_safe(pos, tmp, &b->blocks->miscj, miscj) > - kobject_del(&pos->kobj); > + kobject_put(b->kobj); You're basically putting the parent as many times as there are elements on the ->miscj list. Basically what Greg doesn't like. Him and I need to talk it over first whether my gross hack of grafting the bank4 kobject hierarchy from CPU0 onto the other CPUs on the node is even viable so stay tuned... > I think this is the simplest way to fix the current implementation. > But we should probably get rid of this kobject sharing idea in light > of Greg's comments. You said it. :) Or maybe do a better one. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette