Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5321663ybl; Tue, 10 Dec 2019 04:12:51 -0800 (PST) X-Google-Smtp-Source: APXvYqya0VZW33kqbWqoJW5fkVZgZBfb+EF0co6Ih7Pt/XJrk8tHLUsPkk9+bosUYX1K8LKmYfJn X-Received: by 2002:a9d:7393:: with SMTP id j19mr24662355otk.336.1575979971080; Tue, 10 Dec 2019 04:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575979971; cv=none; d=google.com; s=arc-20160816; b=Y5SUMdoV/CO+OCgH4aGUg3MDtVJH6oW1+o0MsDdbkNVi0ABn4Pn78wJf1t+tyPI2ef cmBmw8t7VCPGJUQ38wc0K2iOGAAU2SeflTQCCBi1nwQSO4P/miQkAnyz8anYWNLuqK/v Tzsh8ODo5QccW0CqI80CVGw6qC+XiyrAJ5N83If7cLz1myUVdxFpol3KcDppxZzqCom0 gUDifcoFoR37m8YXBFhlZ9F34BVnVH0GJ10JzTnBFReSCaRP3hxgoUgrtjaiRxRIHihS M8B4V6znmtHCrKb4/5QajJtX7XvgzdSo3vD3aTC3IQYnaxA2UTf0Quvsbd/7PR1kaBqM 7Ysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=1Yz8O3f/m1g7LWK6aF/bLTiQzm0F53jsud4P5YMuk1A=; b=YcPoeBZEEDbLRAiacsr9Bvb0WEIfJyPuFuq3ckvRFv/DkbO3WxBSYPFuicb6gOzpnW uxGN+jTz0ix62WAAL4ZJ6I9fpTDq/pH2p8/nZN32htQ+du9gay4qi5s1LMmzadnDam2/ bfV006EdyaZV2hXiXzhGsHbjDpF6Ni0b33REOlHteubrNTzGI6nvf/c9acQLztb7tSPb ocHpPgBp6Ey0u95qSf0niJ+YXQ0sCMe2SLzJBM5mlsxBT2K+PGC/Z2m6HA8Vrz0x1PTa bHd+KGGM3vRXNB3NHZXTbiEKOeDlAgIuEn0GDeRyufAyqMsRxE2iYQhCcv34HtwJtdSV 1LKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=ZW+RiShQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si1669109otk.324.2019.12.10.04.12.38; Tue, 10 Dec 2019 04:12:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=ZW+RiShQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbfLJMLk (ORCPT + 99 others); Tue, 10 Dec 2019 07:11:40 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:45232 "EHLO mail-qt1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727272AbfLJMLk (ORCPT ); Tue, 10 Dec 2019 07:11:40 -0500 Received: by mail-qt1-f172.google.com with SMTP id p5so2520555qtq.12 for ; Tue, 10 Dec 2019 04:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=1Yz8O3f/m1g7LWK6aF/bLTiQzm0F53jsud4P5YMuk1A=; b=ZW+RiShQX8qoAcQ2tPP4n3ru4Eev41rBDxV8QxBHs6VQiE8GYWm1u90R+2UN0yoEL9 iZkFuKQIZeUW9dwHzurwsY5NjXE9/6oHV8OTMl1MuKXSlwlz0OHZuTpys9N/C2wKfhr7 7I3LFh2KdYpSpeRoqbd+xH2r3r9GJJSGc6yQHis+UnwCy0NFypHbimHWgGlPS9hzZRzK KWztt8rgqVwAg/KwOvAxIwPiygC1QLwd3szH745bfRcrpnq3sZ4NKDO/PoN1k+tghxgv D2p3+aw6ys70uTETeCSKsSuMQWp6mjgjzibm4ks3AGuMdL1ylitmy2uu1KfvkbTx8lM6 +sNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=1Yz8O3f/m1g7LWK6aF/bLTiQzm0F53jsud4P5YMuk1A=; b=ndYVQ0ltdYtuCR1P4b5/lClweqZSTk5k++UUVijKqj3BzxW06x9rK9bzBKM6NAo+45 HvZkTp5+HZ/gIej8EhaZLnb3uhTTLG8m6IoKP6B7kYm0c8jcuDVrIPwpuGc7cjNyrZjl K6hwgvOqgI9Uep08JNb+O9CbPU89QnDn1x6beB+UOHS+8dnAR54vU47jys0cXRqQMlfy pYoR0f0RVNrNhk/AbWU/kebkl1kpLErb91RXo1PcOzu7jf+8hDrG5vsLsot3u81wuYYD 4gxAVDC+27MNXBLZXPP9Ae+HAB1qZrFbmdimLJ2OMZcXfejcBOa3701OOnk4xlL7oC+M pvNQ== X-Gm-Message-State: APjAAAXqrOcr9fZGAn7BwdH5zSO3J2I9dkKRDdPdtm8ohHn6Cqcrtklt dTIQuWSJLXI9YWkbeuvGogpRAA== X-Received: by 2002:ac8:5418:: with SMTP id b24mr30100834qtq.226.1575979898839; Tue, 10 Dec 2019 04:11:38 -0800 (PST) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id w21sm1081193qth.17.2019.12.10.04.11.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Dec 2019 04:11:38 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] x86/resctrl: fix an imbalance in domain_remove_cpu Date: Tue, 10 Dec 2019 07:11:37 -0500 Message-Id: References: Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Reinette Chatre , Fenghua Yu , "H. Peter Anvin" , John Stultz , sboyd@kernel.org, Tony Luck , tj@kernel.org, the arch/x86 maintainers , Linux Kernel Mailing List In-Reply-To: To: Ryan Chen X-Mailer: iPhone Mail (17B111) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 10, 2019, at 2:44 AM, Ryan Chen wrote: >=20 > Could you elaborate a little more on the failure symptom? > If I understand correctly, the error you described was due to > r->mon_capable set to false while is_mbm_enabled() returns true? Yes. > Which means on this platform rdt_mon_features is non zero? No idea. I did add some debug code that indicated resctrl_online_cpu() found= 3 resources in for_each_capable_rdt_resource(r). Only the first one set r->= mon_capable. > And in get_rdt_mon_resources() it will invoke rdt_get_mon_l3_config(), > however the only possible failure to do not set r->mon_capable is that it > failed in dom_data_init() due to kcalloc() failure? Then the logic in Very likely. Should be easy to confirm. > get_rdt_resources() is that it will ignore the return error if rdt allocat= e > feature is supported on this platform? If Yes. > this is the case, the r->mon_capable > is not an indicator for whether the overflow thread has been created, righ= t? I am not sure about that. > Can we simply remove the check of r->mon_capable in domain_add_cpu() and > invoke domain_setup_mon_state() directly? That should work too, but it is so perfect align with the r->alloc_capable c= heck above, so I am not sure it is a good idea to break it. > Humm, it looks like there are two places within this function > invoked cancel_delayed_work(&d->mbm_over), > why not adding the check for both of them? Because I am not sure about the second one. It was never executed due to =E2= =80=9Ccpu !=3D d->mbm_work_cpu=E2=80=9C even after offlining all CPUs except= cpu 0 and never cause anything wrong yet, so I could not test it yet, but I= can see why it might need a similar check too if d->mbm_work_cpu is non-zer= o and could trigger the same imbalance.=