Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3236876rdb; Tue, 6 Feb 2024 11:02:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEe1WYI6xuWVqqJSGlLB0C4CCBauQOPZV+ho56iKVT41k5IT2QQ5SuU+iwE3NRX24XDdbEk X-Received: by 2002:a62:5fc6:0:b0:6e0:5281:e0d1 with SMTP id t189-20020a625fc6000000b006e05281e0d1mr429991pfb.1.1707246142402; Tue, 06 Feb 2024 11:02:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707246142; cv=pass; d=google.com; s=arc-20160816; b=uKSdXMTKy7kY31WSizOMz/WJz0zxB71Vz1kpnozXvZM/AnaVkCbOvb99bAcxSaZTVU 330WcYlxfbVqIeVQtqBiJzMxVPyQ5YIKUrz11+rRD5C+wy6fkOAv5d58l/l3N1FyTBud 6YYuUAmEyVDKss3svIwHQqYvcW0i9hEk2h1gz8uosyVP9uO2DfeKsW5qujTgIhvCgoIP laUJzQT5P3YrGtwv2+TqbDyhno90r8MW3F6wFk2YP0IV2+ODVHLTLe4zFNgL+B8tzLe2 MBm1zTT4Y19optkz8pIRAqw5Uy3+dmcnKU/MTfcUP44hci0pg7gjCmsV3aQ+9b8GZi16 gGaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id :dkim-signature; bh=k9Gh7G7xTrMd8YjXBJXK/0OngeF3ZzVghgrC9df1T2I=; fh=7Y+6Q+rNEH//Nk/wdAi5PdJCM7JW713fuwMWTjfjyOM=; b=vqGACI+sjY+biA+Zd7lCGCDgc0TDJbBVaGjHG9ketUAcNHOpCXrcj5+eNz6Fh3DZ+K xROlEq4NYyQK2ZzuPdBUGtgfN/gIDsfqDwwaZT+L9GxlmerrFrZ/c9ckUhWF+2yjXaGu 7LxfpaXxiiMneuq+yZ+1KA6YGgrtgLje95PY5ru8RmZeYxXTYw34My1fZ4MZywmN8IUr fq6+a+8IdDw16xQaXSncex1GjNGDw90aR90YcrQXJNNYReITgu72zVkdiEgddHQ+dYY9 Z8kY1UyACUqqZ8tBiQNKsmfA+fzNTYlgFIMOIQRBvyA92/RnqAWMqZE7ZGxOrSNw9kqU 4Zlw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HlRKy6zc; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55523-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWKxbiUc4l5ebeOBllLYL5x8KWeOLXfUrW3Zr7+S+ZL5FW89RbOTk1HOZT6pB7JKGVMPr5+30cLfZeDZjV1GZXUegmM2SVNLaNMww/6Rg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m16-20020a62f210000000b006dbe42bbfdasi2009835pfh.377.2024.02.06.11.02.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 11:02:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55523-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HlRKy6zc; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55523-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6BE442929FD for ; Tue, 6 Feb 2024 19:01:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAADC1B286; Tue, 6 Feb 2024 19:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HlRKy6zc" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 996ED13AE9 for ; Tue, 6 Feb 2024 19:00:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707246035; cv=none; b=LbiGGkiLDm8L1PZBIK7VHVYHp8RavZNlk+RInT+6E0HPiYLqlyyIKA2WT69comSI0xYU4Vlzk5wdh91XRs9uuX8dyrAUpcUbnKl69FEGw12n8P13j6SpMw3gFqoF92w/bBjmILJ3iRY3zxYcs3N/aFTJu6PEWefesIfc01yj1aI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707246035; c=relaxed/simple; bh=0oVR2iX1MWiDWezzOf++9ZQng2r7sLEq/QSolw3KecA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=XfwnEfybxd6/ZXjYdAbGA2oQg9oA03Xh6DoiYk8JwFiYYI3ojdf3juGbU1ythBqtzsOIooNQb4XqGzSAkFuUB4glXny83gNcQJWDob3hiFnJwfaaBjQy0utbTPxm4us6/SQNQ9MFsKRtuem4TXaDyccN0lbf1+9YKeD6tx7u408= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=HlRKy6zc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707246029; 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: references:references; bh=k9Gh7G7xTrMd8YjXBJXK/0OngeF3ZzVghgrC9df1T2I=; b=HlRKy6zcw+AyOpNMeSdFy7/yMXCBFJf51XpPnfbKyyMOvfVvvM9/K5SPzX/K+0Go1URlf0 K0YbuJ4fjVluH6fjVAkg7TGLUPc9I/cqGrZbeoGoxWkfKAvD8vXwkro6t2pPHwQk6g1+yY Ow+hQItp3V2PlhotvW0gUWYCygMtFig= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-259--v_AD5UKOy2ld9z7HOoj2Q-1; Tue, 06 Feb 2024 14:00:24 -0500 X-MC-Unique: -v_AD5UKOy2ld9z7HOoj2Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C7DF185A780; Tue, 6 Feb 2024 19:00:23 +0000 (UTC) Received: from tpad.localdomain (unknown [10.96.133.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45A581C060B3; Tue, 6 Feb 2024 19:00:23 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 54400401DED49; Tue, 6 Feb 2024 15:58:07 -0300 (-03) Message-ID: <20240206185710.116221062@redhat.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 15:49:22 -0300 From: Marcelo Tosatti To: linux-kernel@vger.kernel.org Cc: Daniel Bristot de Oliveira , Juri Lelli , Valentin Schneider , Frederic Weisbecker , Leonardo Bras , Peter Zijlstra , Thomas Gleixner , Marcelo Tosatti Subject: [patch 11/12] x86/resctrl: use smp_call_function_single_fail References: <20240206184911.248214633@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Convert update_task_closid_rmid from smp_call_function_single to smp_call_func_single_fail, which will fail in case the target CPU is tagged as block interference CPU. Signed-off-by: Marcelo Tosatti Index: linux-isolation/arch/x86/kernel/cpu/resctrl/rdtgroup.c =================================================================== --- linux-isolation.orig/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ linux-isolation/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -551,12 +552,20 @@ static void _update_task_closid_rmid(voi resctrl_sched_in(task); } -static void update_task_closid_rmid(struct task_struct *t) +static int update_task_closid_rmid(struct task_struct *t) { - if (IS_ENABLED(CONFIG_SMP) && task_curr(t)) - smp_call_function_single(task_cpu(t), _update_task_closid_rmid, t, 1); - else + int idx, ret = 0; + + if (IS_ENABLED(CONFIG_SMP) && task_curr(t)) { + idx = block_interf_srcu_read_lock(); + ret = smp_call_function_single_fail(task_cpu(t), + _update_task_closid_rmid, + t, 1); + block_interf_srcu_read_unlock(idx); + } else _update_task_closid_rmid(t); + + return ret; } static int __rdtgroup_move_task(struct task_struct *tsk, @@ -604,9 +613,7 @@ static int __rdtgroup_move_task(struct t * group go into effect. If the task is not current, the MSR will be * updated when the task is scheduled in. */ - update_task_closid_rmid(tsk); - - return 0; + return update_task_closid_rmid(tsk); } static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)