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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 424A0C77B73 for ; Wed, 19 Apr 2023 16:47:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0D74900002; Wed, 19 Apr 2023 12:47:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BDC86B0072; Wed, 19 Apr 2023 12:47:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88567900002; Wed, 19 Apr 2023 12:47:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 780E86B0071 for ; Wed, 19 Apr 2023 12:47:35 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4373FC0384 for ; Wed, 19 Apr 2023 16:47:35 +0000 (UTC) X-FDA: 80698721670.30.EFD8482 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf17.hostedemail.com (Postfix) with ESMTP id 299E440018 for ; Wed, 19 Apr 2023 16:47:32 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=HeixTkZD; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Qq1iYoqP; spf=pass (imf17.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681922853; a=rsa-sha256; cv=none; b=N/AQWUCfY8dwre7Ysvy9VkocM2Cy4Z/2bgYfe41FcvhZoelJ4/KyCbH7qQRLArY7gpcRPm yoZqDltUp9jwDGwopOJTGDTZhX0Gcp2XbRL/JHJ6CyXxmlSUHP13MQox3Guc1tukGixORl sMyXk/a/acSgpsncIisQ5SAZmmgpQug= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=HeixTkZD; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Qq1iYoqP; spf=pass (imf17.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681922853; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=R7n8VKpCcuyDgTxe9PzLJnL7YYi0wPZnyKfOG+vA4Qc=; b=eikWqnAvM3xZRpEgYeU/cSMhmHQ6LGbjcqVeu4I5Pp8H3FvXFLUwMrqsZiOPpLdWgTzc9C bc44afeHheGERurzhz+ftAAusTCYrmq3eVjU6e2sJHQXo5M/P2w9ayYhj9xsC2SuAtRxl6 DwpfDf8XmBtJTMM+ufU35Oafvy+V8Wo= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6B78D1FD98; Wed, 19 Apr 2023 16:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1681922851; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R7n8VKpCcuyDgTxe9PzLJnL7YYi0wPZnyKfOG+vA4Qc=; b=HeixTkZD59JVtb74nipavgvSlQn//sMl5NVsI/y3gPbSs2BeoMGqEqoXJJsV9xLOSGB/GY Xm4u2uK/dTxrNE566wDiVRuAZRsG/kqBpARc+Aa3Nn/sa8/ozNxFYQ+RjsEUZb/Rtx+awD ooTJQu3kUUYWyCXhpDziWkrvipzuM5s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1681922851; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R7n8VKpCcuyDgTxe9PzLJnL7YYi0wPZnyKfOG+vA4Qc=; b=Qq1iYoqPtPkJNNrXPQltI6ODmAFphQxpVDVdEFN6p+jUgu0P3afq91021gagmRxGPpRQas PQvIHvuU7yB45NDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2C73613580; Wed, 19 Apr 2023 16:47:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7nSaCSMbQGR3QAAAMHmgww (envelope-from ); Wed, 19 Apr 2023 16:47:31 +0000 Message-ID: <1a481d68-930e-9418-a9aa-befdcfe36928@suse.cz> Date: Wed, 19 Apr 2023 18:47:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v7 00/13] fold per-CPU vmstats remotely Content-Language: en-US To: Marcelo Tosatti , Andrew Morton Cc: Christoph Lameter , Aaron Tomlin , Frederic Weisbecker , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Russell King , Huacai Chen , Heiko Carstens , x86@kernel.org, Michal Hocko References: <20230320180332.102837832@redhat.com> <20230418150200.027528c155853fea8e4f58b2@linux-foundation.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Queue-Id: 299E440018 X-Rspamd-Server: rspam01 X-Stat-Signature: fuhs5r37g5fzefk8qw1ryxdb1aeiubkq X-HE-Tag: 1681922852-709317 X-HE-Meta: U2FsdGVkX19+ocSECdhUJ4S2Q7Tlr4UNvHX+RwHyflTGIm0p0xcENRZ9S8e3VMema6fWXc4P91KSBHsXvxYxb9AR1JxVjj0jH4BkJIxjfdCc0cF6Rfx3LCMrTiJ7I7dS20RKWpNClzaFcmF3eDkUuBsTH8j+MNoOFbfdAooeccz5OymlYA71FlGtZavjybaheZh+YYFVH0ZwXrpMBZoCYCuNVnxG+Biislkexw8h7/nF+tmJNAewjRmeQGAmdnlEtZE0dk0YuylziFFwG1AaDkdlarYL+sXFkiuVu1OhR9PSFNM1hMe+0yubdnQH7/T2l9yGRnbuT7ixo/V2FobD7zrIQjbFtLboGO/2afHvhdWhiutO3T8O46pQaTzDOgefWYXdzcOO07C+Fga4VIrZ67Z7hYTbmI+zy1Knb2mqHRkpchiaLklAAlxjE5O+RJfJGt1fek/XpbBNtm6L7517FWghEHYHSrjkw0YScqPgTYtiM/O12L+Sgr2LY9z6jGDdQD1OSbETNWEeydGjB7qeZIrlJKzg/DlJwoEyP+n8eAd8LUfrhl7hJqpO7cadDdoceT91laAQ+3YgaC5+e1R4xQtpsIwOWbTGM9A//S0E2AtnLT+ijbFfPf4NqSYAUiiNFVrX/X1GqXaF8KFNbiDb1OWrljWRBWdNthNveM13cbXRxnl0xqzAq3cw8MQmSE2QpFGAAYie0QKvmY4fmoTEszssBA3ZNfJvgIPOBarHx++VGD+9dy1MPxrZDcqdmRO1U+siRfB4VbtEL7DUis8/5NlNqK81wbZnO2pgCmle9bjfQ0786MK1OXOaXBb9heA5sE2bzv4nHEv+VZSmizWPKoTI+nhph8AA8PVSh0NzRnkZfws4hrGJpDsrpferUADEp2xwzm4tMFbCvfuGmTWjXB0vatOEGrxwL2C7Z6BDe7w17VbL/Dk0nnRx0uO188xUZfKyzqBHERr5kLgKDxq 23LXt0Ym iHlB2qf+5zVQNSHv9VT5LDz/v+gb77aajNHh0g0Pjv1r5+oHz2uM1ldEWCqUZW+QZBt7PZ92DUW8/Eb6GJ5/q4FlCOG91TYFaYAwCsgxUeclogcgV+Fs8fWwabObsSBv0Xw84z+ZpVKKoUPFYuF0pmuaFYx1QmlCqePxluRlFplFRzhWPGq6/y+mp5ukDvenoAUnrOg2QGHWxiMSJiemRC6VdzyKf725w/F7S1Ecba96/icdSSu1mBZFkZKY8eRpaPzms0s8EUdrfDZmAPLqtzHgakw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/19/23 13:29, Marcelo Tosatti wrote: > On Wed, Apr 19, 2023 at 08:14:09AM -0300, Marcelo Tosatti wrote: >> This was tried before: >> https://lore.kernel.org/lkml/20220127173037.318440631@fedora.localdomain/ >> >> My conclusion from that discussion (and work) is that a special system >> call: >> >> 1) Does not allow the benefits to be widely applied (only modified >> applications will benefit). Is not portable across different operating systems. >> >> Removing the vmstat_work interruption is a benefit for HPC workloads, >> for example (in fact, it is a benefit for any kind of application, >> since the interruption causes cache misses). >> >> 2) Increases the system call cost for applications which would use >> the interface. >> >> So avoiding the vmstat_update update interruption, without userspace >> knowledge and modifications, is a better than solution than a modified >> userspace. > > Another important point is this: if an application dirties > its own per-CPU vmstat cache, while performing a system call, > and a vmstat sync event is triggered on a different CPU, you'd have to: > > 1) Wait for that CPU to return to userspace and sync its stats > (unfeasible). > > 2) Queue work to execute on that CPU (undesirable, as that causes > an interruption). So you're saying the application might do a syscall from the isolcpu, so IIUC it cannot expect any latency guarantees at that very moment, but then it immediately starts expecting them again after returning to userspace, and a single interruption for a one-time flush after the syscall would be too intrusive? (elsewhere in the thread you described an RT app initialization that may generate vmstats to flush and then entry userspace loop, again, would a single interruption soon after entering the loop be so critical?) > 3) Remotely sync the vmstat for that CPU. > > >