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 53829C636CC for ; Fri, 3 Feb 2023 18:52:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3D046B0071; Fri, 3 Feb 2023 13:52:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C59A6B0072; Fri, 3 Feb 2023 13:52:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 866216B0074; Fri, 3 Feb 2023 13:52:42 -0500 (EST) 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 6939D6B0071 for ; Fri, 3 Feb 2023 13:52:42 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2726FC0611 for ; Fri, 3 Feb 2023 18:52:42 +0000 (UTC) X-FDA: 80426876964.27.57570F3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 1465220020 for ; Fri, 3 Feb 2023 18:52:39 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OmXPBpzg; spf=pass (imf13.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675450360; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KeW1akqqTvQD5RyZenW9QkipgaQxGjnSO+zPQwmfIxY=; b=zmD6081a9/RnX3nKLScR+/76wXdEjv1o+dduuf+wbr72M9Gk1h66ssPSFCo5X3ixMK94g3 THXDDjYjBAnTLcjeQMcVtqZ6y/mqH/sJDPWBNXYfaKiasOQRbSeaXg9ieM1gboMXsMAGuR 6qaM2YEStbzjTuMyjz1DYm4uEZTirlM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OmXPBpzg; spf=pass (imf13.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675450360; a=rsa-sha256; cv=none; b=Dn8ruPIFnEYoZv0xk1Qp6lttXhVY5deqyyR9Sge7Gq3c9qtqodvvjdQZ1okHbu5vahK/jC 6S/qEPGSHH9/23aDH3vZ0HopZPNrC6nW3w57Li0hNGln58Y9bfkXw6o0Iba/t42yd1ZoaL stuq3iLf0s6o+9ct7IV09h7ryTCP804= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675450359; 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=KeW1akqqTvQD5RyZenW9QkipgaQxGjnSO+zPQwmfIxY=; b=OmXPBpzgdQv/F6VOfBPp2vVYTxQRtUELQBtJZnoH1ahvRwqbrADhdReBFhKvHFt70b9lH4 nK4lYhI9Pbf9AP/NOp4e1hfr9WPETTZrzGhBUOyuQ2cUVMLiorsCYbC5FFHlDHUxqwIsDH DI6YaN8iKg1I+FNDsAyiPqNTHQqxnaI= 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-647-All7GBLkN0K_IQl1mE4KMg-1; Fri, 03 Feb 2023 13:52:34 -0500 X-MC-Unique: All7GBLkN0K_IQl1mE4KMg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AA08100F90A; Fri, 3 Feb 2023 18:52:33 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9303112132D; Fri, 3 Feb 2023 18:52:32 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id A1719403C4285; Fri, 3 Feb 2023 15:52:14 -0300 (-03) Date: Fri, 3 Feb 2023 15:52:14 -0300 From: Marcelo Tosatti To: Christoph Lameter Cc: Aaron Tomlin , Frederic Weisbecker , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 3/5] mm/vmstat: use cmpxchg loop in cpu_vm_stats_fold Message-ID: References: <20230201195013.881721887@redhat.com> <20230201195104.460373427@redhat.com> <5615572-974e-74cc-6c34-1de618b777cf@gentwo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5615572-974e-74cc-6c34-1de618b777cf@gentwo.de> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1465220020 X-Stat-Signature: g9oq3fbqdmb9u8hk11to9snortz9m4yy X-HE-Tag: 1675450359-615815 X-HE-Meta: U2FsdGVkX18WX4PiTEPzSz+a9sIA0WLrwl/c8MG88GMzvd93+2dmmSQx0ZmXF1L5nRCkr441Bc6TnU9D3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XiBifLfRYSBbNob48Zx1ZVMZY/xOaIaiGT2Cye3aX/Wu7cd4r6BkUJoVQL4lbSqcwnRVTklPFgLA== 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 Fri, Feb 03, 2023 at 10:34:22AM +0100, Christoph Lameter wrote: > On Thu, 2 Feb 2023, Marcelo Tosatti wrote: > > > > I thought you would only run this while the kernel is not active on the > > > remote cpu? Then you dont need any cmpxchg and you can leave the function > > > as is. > > > > The remote cpu can enter kernel mode while this function executes. > > Isnt there some lock/serializtion to stall the kernel until you are done? Not that i know of. Anyway, an additional datapoint is: "Software defined PLC" (https://www.redhat.com/en/blog/software-defined-programmable-logic-controller-introduction), applications can perform system calls in their time sensitive loop. One example of an opensource software is OpenPLC. One would like to avoid interruptions for those cases as well. > > There is no mode which indicates userspace cannot enter the kernel. > > There are lot of thinngs that happen upon entry to the kernel. I would > hope that you can do something there. Scheduler? The use-case in question is with isolation, where a CPU is dedicated to a single task. So the scheduler should not be an issue.