From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F209C432BE for ; Wed, 1 Sep 2021 18:34:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86BA061054 for ; Wed, 1 Sep 2021 18:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245395AbhIASfC (ORCPT ); Wed, 1 Sep 2021 14:35:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60687 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245252AbhIASfA (ORCPT ); Wed, 1 Sep 2021 14:35:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630521243; 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=eoBhMvgpUyVFmtcdbP63Ins4CKJl/eFrVZgtETSUvtU=; b=YkZMIN1U+tMLCNmPYTaaWLzbbunWrng09HIIUrBWGpFpC49uTG9AKNuxohcbvXIIF4pBKa Z+QjiQEwcbK9eloTZmHNBA6+/B8HM0F4rjzrc4iQGyljuBE5BVEAkSA+bJ6hjqlgRftFxW E2yVGoiZIH2+0LtD8WKF7+djc8bbux8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-sgV21N80M0-ipD00FMLbbg-1; Wed, 01 Sep 2021 14:34:01 -0400 X-MC-Unique: sgV21N80M0-ipD00FMLbbg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C86AC6D4E6; Wed, 1 Sep 2021 18:34:00 +0000 (UTC) Received: from fuller.cnet (ovpn-112-3.gru2.redhat.com [10.97.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C925110027C4; Wed, 1 Sep 2021 18:33:53 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 965644172EDE; Wed, 1 Sep 2021 15:33:45 -0300 (-03) Date: Wed, 1 Sep 2021 15:33:45 -0300 From: Marcelo Tosatti To: Nitesh Lal Cc: linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , Frederic Weisbecker , Christoph Lameter , Juri Lelli , Peter Zijlstra , Alex Belits , Peter Xu Subject: Re: [patch V3 8/8] mm: vmstat_refresh: avoid queueing work item if cpu stats are clean Message-ID: <20210901183345.GA51358@fuller.cnet> References: <20210824152423.300346181@fuller.cnet> <20210824152646.948424573@fuller.cnet> <20210901173204.GA48995@fuller.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210901173204.GA48995@fuller.cnet> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 02:32:04PM -0300, Marcelo Tosatti wrote: > On Wed, Sep 01, 2021 at 09:05:55AM -0400, Nitesh Lal wrote: > > Hi Marcelo, > > > > On Tue, Aug 24, 2021 at 11:42 AM Marcelo Tosatti wrote: > > > > > > It is not necessary to queue work item to run refresh_vm_stats > > > on a remote CPU if that CPU has no dirty stats and no per-CPU > > > allocations for remote nodes. > > > > > > This fixes sosreport hang (which uses vmstat_refresh) with > > > spinning SCHED_FIFO process. > > > > > > > I was still able to reproduce the sosreport hang with this patchset and I > > am wondering if that is because right now we do vmstat_sync and then cancel > > any pending jobs on a CPU in the context of one task. > > Hi Nitesh, > > Did you use chisol (with proper flags) and the modified oslat? > > Tested with "echo 1 > /proc/sys/vmstat_refresh" and it was successful > (no hangs). > > > However, while this task is running another process can come in and can > > dirty the stats resulting in vmstat job getting placed on CPUs running > > SCHED_FIFO tasks. > > Am I missing something? > > What we can probably do is to communicate that a CPU is running on task > > isolation mode to any other process that is trying to run and schedule > > jobs there. > > No, that can happen. Can use sched notifiers to handle this problem. > Good point. Well, actually: the goal is an isolated CPU. So task A (latency sensitive, in task isolated mode, polling) executing on an isolated CPU will require something like stalld to execute this other task that dirties the vmstats. Therefore stalld can also sched-in/sched-out vmstat_worker, with similar impact to latency.