Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2401736yba; Mon, 15 Apr 2019 10:50:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3I7yku48AamSsi2ogcCTCID0g6uuXzlkGtUBdEZjB0QEAchDIYDsIOOlNSPENOqt7THGG X-Received: by 2002:a62:4558:: with SMTP id s85mr77123951pfa.171.1555350615540; Mon, 15 Apr 2019 10:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555350615; cv=none; d=google.com; s=arc-20160816; b=yeoOW8RmOBWjL+d+svWjFZqVDLR1CP2OWsDOeUNMCeOGFR7n3NJ2XI4iX+2iNEy7PE 7Zk/qiDKdewiBFACSeo+4oMiaFXXPhbNRgvA5MGro2mc3Q6qho+Hx4qitu4LlA7DGeQJ BbKH65T2lAvtBJgGTDNdv2mCprF3KB2xizUjaIP2+xUlHVzqEhE51LqbfBeeYRXOSObk gv2I+lWcknCRwfTouFERnVpS/BMvhlGNRRKKAQKszYeeMs3ee0XcVco+QCzS/0wmoJXo Z9PbK1gRRGXQPlVDQNc+k1F/+MUDZ7l18LsbMqDKUtRbP8FSKJ0gBkVj7b5jTucIFVOe x/Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=avV9dZ4pPRg8tX22GHAisWdDdC1du7r40MwLPAtDyuA=; b=DAMT+Rew4yKK7QtY4ZqsE0pI4dcU+XqiX5QJMr70g+hYywoFXOGFL8hl+kzt6QF0uh L2bB2sO3Ut5ixJSzBfkYtfHQ/aaA4q03XoPTMvToZErK2LkX/nZm9k2prToU0lZO9BEf J/zDsPNbtfTBWHiqYxqRFWcRX4dZJq2zvyyy8S1nR5DAjc2zs1Hb8EuYEsvytjRULY3H PObE1JKr1B8buQq6Q1r8hjvygkMDA/nKjCcw0M7XERz0bSMmnIRWPy6UhjLHzhdunxgn j/l3kggm8ekgSVy2p0sefZkE98OGwC9NMZDZgRNZKIO8bPC07fhZBgYC/DQH2D/CARF4 tXbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GZ1ZZFbA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f36si46066537pgf.332.2019.04.15.10.49.59; Mon, 15 Apr 2019 10:50:15 -0700 (PDT) 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=@google.com header.s=20161025 header.b=GZ1ZZFbA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbfDORVK (ORCPT + 99 others); Mon, 15 Apr 2019 13:21:10 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:38411 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfDORVK (ORCPT ); Mon, 15 Apr 2019 13:21:10 -0400 Received: by mail-ua1-f66.google.com with SMTP id t15so5776345uao.5 for ; Mon, 15 Apr 2019 10:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=avV9dZ4pPRg8tX22GHAisWdDdC1du7r40MwLPAtDyuA=; b=GZ1ZZFbATO9m4LJ6YAFkqdFgQHCIFMXdWDv8x47rLF7o51Bn0Q5iwiQgJGMdl1opIy Okc01kBp4fo0+fyOpGRfxiQv6X891zIvSyQXA/MWUlI10ldmOwsPyrbM7B9+zZUHSHZg YWv2NCfIFve31VYQHF46y8Dff6PRVW3CKYrFfGeJJYe0UwjRM2uR7X4YLwuZtQ+yXERH V0mlhaea77ATv8TrLUBb7jTePVutlx8XHQd67B1UsNdnUtIMQCbuOD1f6Fg5f9xg19BD 9YJzbS7qc/9b220O7NeJzj/RSv4GH04EOBFvhoulyxVNvNWfITNfgiPzJR2eWBY1Wz6g pz0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=avV9dZ4pPRg8tX22GHAisWdDdC1du7r40MwLPAtDyuA=; b=EFbwMX/9CzFko2R2QNcNrIAmL5rZ7qby7zPz8NN+PL1Oz7I57ZyWU7IXE0SDy/j4Pl 1A0mkcjGoWPeYgaFMpvIDsr5F+Cnb0R7mR6szYNkSBnYp+0hbJuTY1L/WKa4ZppU1fom CzeoU0yCqbo6nuCBbENxb0Zl0icGomL5/eSmlmMSj35V3p+GiblggJtWxxVMp0mbIsZj iI/agQg9AzAtK2YBqBOjYaVuIP//40ZJqGF+9JMLCu3X1WWrIu4IYWDuDOBUNSgbBwr8 7OMeJ33yld7O6QvpFqUhniawM5zDIHDiTUAAGcLyRcPXCwKIj+noUnQv/UW4/V5XGhey X/fQ== X-Gm-Message-State: APjAAAUvYwjz2qyKaB1kKd0iUEis8crkdJsF0MqexktlxyfNOgWCDsHO 69NoQvvNF3oK4d1h4RlV1h0cD3n+/d8+EOnynVmjLg== X-Received: by 2002:ab0:130b:: with SMTP id g11mr1652044uae.74.1555348868873; Mon, 15 Apr 2019 10:21:08 -0700 (PDT) MIME-Version: 1.0 References: <20190408173252.37932-1-eranian@google.com> <20190408173252.37932-3-eranian@google.com> <20190415155742.GI12232@hirez.programming.kicks-ass.net> In-Reply-To: <20190415155742.GI12232@hirez.programming.kicks-ass.net> From: Stephane Eranian Date: Mon, 15 Apr 2019 10:20:57 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] perf/x86/intel: force resched when TFA sysctl is modified To: Peter Zijlstra Cc: LKML , Thomas Gleixner , Andi Kleen , "Liang, Kan" , mingo@elte.hu, nelson.dsouza@intel.com, Jiri Olsa , tonyj@suse.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 15, 2019 at 8:57 AM Peter Zijlstra wrote: > > On Mon, Apr 08, 2019 at 10:32:52AM -0700, Stephane Eranian wrote: > > +static ssize_t set_sysctl_tfa(struct device *cdev, > > + struct device_attribute *attr, > > + const char *buf, size_t count) > > +{ > > + bool val; > > + ssize_t ret; > > + > > + ret = kstrtobool(buf, &val); > > + if (ret) > > + return ret; > > + > > + /* no change */ > > + if (val == allow_tsx_force_abort) > > + return count; > > + > > + allow_tsx_force_abort = val; > > + > > + get_online_cpus(); > > + on_each_cpu(update_tfa_sched, NULL, 1); > > + put_online_cpus(); > > + > > + return count; > > +} > > So we care about concurrent writing to that file? Not likely but we care about seeing the effects on event scheduling before the sysctl returns.