Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6125701rwd; Mon, 5 Jun 2023 13:28:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Unxw3nfMUDlXo38WoXR6eHIL5zNNTDIKaT6sTAix5M9urOQr7IyGywzBIHgAI9YsSJwoc X-Received: by 2002:a17:90a:1a0c:b0:259:42f2:1fd5 with SMTP id 12-20020a17090a1a0c00b0025942f21fd5mr2101121pjk.26.1685996925038; Mon, 05 Jun 2023 13:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685996925; cv=none; d=google.com; s=arc-20160816; b=nL9IRQNT+2gZv6+1pXvA89FpUaSjEgnKhBBv8mKerY6n5QeDODi7Mma6cUTsC4okW6 oFRoyvwUSk/7sNenH735O3gT0f+8edzWxppkuw+PFNLPyBSv6lqqMiMVz1IsOxdj29zF P4B1RW2Xone3DmCgkgnYtpJNZjOYcFyxR8jA5Jik0Rn4suUAI9NIJSEcJn2QOinfuNhd Pri8APbpeCnKtaWfsI0XKXPi7qRlGaxSVSoqR2PNmxfV/mJWAczs5eFpvsrxK9l8I6TU CUm7Oce0FWhHD/YA6p6NkEhNg/p0mU+d7oclJcV/VrydmcmdBKNwMpc92X7TJWejURnA i2AQ== 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=fhotjoqtlTKm+Ky5u6YN7fnyK5g1HzY5C6hXhYwr86s=; b=LL6KqAuCuUXRMdbbvCWaneRijUqNiookB1pqdV88z7zYWqvl2sxODpt0j9aPtsrq9T MSu4HiJMEKZC3/SdiZSuhaK3/DdwROrlvuEq675GIcXsCTyknhoSNkUsV7pUmpRy4J1U oUVc/c5yY88tMovR+mdxJfKiOXjma7w+0Z1JDGrBzcvbWulrgGnMSpADnOU6c4JEXK6R VvxqeJGhnPPPN9ENiv/pQtRqV4sJzFH3oAEcuVszohAVmanvTehlsIrMYRvM4xl6BxjX p10Hr0c7PTRbKxOE1++xIkn3E5OiHUm2x+ITqxH9vEKQwUTanycxYG5iysehgD1NnVqK //6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cou1Vv5i; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk12-20020a17090b224c00b00250db0f5689si6434256pjb.179.2023.06.05.13.28.33; Mon, 05 Jun 2023 13:28:45 -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=@redhat.com header.s=mimecast20190719 header.b=cou1Vv5i; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235996AbjFETzY (ORCPT + 99 others); Mon, 5 Jun 2023 15:55:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235469AbjFETzW (ORCPT ); Mon, 5 Jun 2023 15:55:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19E77F4 for ; Mon, 5 Jun 2023 12:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685994861; 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=fhotjoqtlTKm+Ky5u6YN7fnyK5g1HzY5C6hXhYwr86s=; b=cou1Vv5iXE7z0dk1FroXcEsiZJBbJs4eC6HbjegufWS8XSZs1f0xlGVBq5sJquP7T+QlAd 8O01ZRd1zQ+I+0Tu10S63LSKEn10egteMsbHWrklfIZ5Fl360G6uQ1N3hk8UCNdZRzW7gg iGDj3s1Dd9GkchMN7jgc3/X0l3zrlIU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-324-4mCY2ZSYPGyTBc46UN_-JA-1; Mon, 05 Jun 2023 15:54:17 -0400 X-MC-Unique: 4mCY2ZSYPGyTBc46UN_-JA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62AA9802E58; Mon, 5 Jun 2023 19:54:17 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-3.gru2.redhat.com [10.97.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14C9240317D; Mon, 5 Jun 2023 19:54:17 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 881F340CAC207; Mon, 5 Jun 2023 16:53:51 -0300 (-03) Date: Mon, 5 Jun 2023 16:53:51 -0300 From: Marcelo Tosatti To: Michal Hocko Cc: Christoph Lameter , Aaron Tomlin , Frederic Weisbecker , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka Subject: Re: [PATCH v3 3/3] mm/vmstat: do not refresh stats for isolated CPUs Message-ID: References: <20230605185627.923698377@redhat.com> <20230605190132.087124739@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Mon, Jun 05, 2023 at 09:20:12PM +0200, Michal Hocko wrote: > On Mon 05-06-23 15:56:30, Marcelo Tosatti wrote: > > schedule_work_on API uses the workqueue mechanism to > > queue a work item on a queue. A kernel thread, which > > runs on the target CPU, executes those work items. > > > > Therefore, when using the schedule_work_on API, > > it is necessary for the kworker kernel thread to > > be scheduled in, for the work function to be executed. > > > > Time sensitive applications such as SoftPLCs > > (https://tum-esi.github.io/publications-list/PDF/2022-ETFA-How_Real_Time_Are_Virtual_PLCs.pdf), > > have their response times affected by such interruptions. > > > > The /proc/sys/vm/stat_refresh file was originally introduced > > with the goal to: > > > > "Provide /proc/sys/vm/stat_refresh to force an immediate update of > > per-cpu into global vmstats: useful to avoid a sleep(2) or whatever > > before checking counts when testing. Originally added to work around a > > bug which left counts stranded indefinitely on a cpu going idle (an > > inaccuracy magnified when small below-batch numbers represent "huge" > > amounts of memory), but I believe that bug is now fixed: nonetheless, > > this is still a useful knob." > > > > Other than the potential interruption to a time sensitive application, > > if using SCHED_FIFO or SCHED_RR priority on the isolated CPU, then > > system hangs can occur: > > The same thing can happen without isolated CPUs and this patch doesn't > help at all. > > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978688 > > And this is an example of that... > > > To avoid the problems above, do not schedule the work to synchronize > > per-CPU mm counters on isolated CPUs. Given the possibility for > > breaking existing userspace applications, avoid returning > > errors from access to /proc/sys/vm/stat_refresh. > > > > Signed-off-by: Marcelo Tosatti > > It would be really helpful to not post new versions while discussion of > the previous one is still not done. > > Anyway > Nacked-by: Michal Hocko > > This is silently changing semantic and I do not think you have actually > shown this is a real life problem. https://bugzilla.redhat.com/show_bug.cgi?id=1921601 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978688 > To me it sounds like a theoretical > issue Its not (see data above). > at most and it can be worked around by disalowing to use this > interface from userspace. stat_refresh is mostly for debugging purposes > and I strongly doubt it is ever used in environments you refer to in > this series. Based on experience, I strongly believe people will run latency sensitive apps and end up reading/writing this file.