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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBDC8C636CC for ; Fri, 3 Feb 2023 09:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232836AbjBCJe6 (ORCPT ); Fri, 3 Feb 2023 04:34:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232797AbjBCJey (ORCPT ); Fri, 3 Feb 2023 04:34:54 -0500 Received: from gentwo.de (gentwo.de [161.97.139.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECF661C580 for ; Fri, 3 Feb 2023 01:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.de; s=default; t=1675416862; bh=GlGVwWemaTv9wxXmIiCPESQ0KUcHH+OiHbxiUkvkm/A=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=LnNxXgI15WmHzxM7j+mcDQLR4hn1USAgC0xdofHy8qoC5S6f8+52TAzeqVUpCZyAF rd7+nbsVrhNtkxvO+jn4Kqj3eudf8Vi9B3qEr1v9jhOzgGznEVQrrsyu/eOFCF2Oqo IIqv++rNrgWhjsdTzclIMZXsxeAkOEF3NVgyMVXWP2MUtFEh1R9JQRDwtlq2xKkqJ7 Zh/Af5XxCg+lezg3h+XeXZfwZw4XQJEK3v+MmrOzJLa/kDjSarqZMG6/rFYCd7YSW4 CzOLmi2tN3lVyYMv1MRFYv1V/1oFHXxnWl6AXuGlRaDIwXVjlrtLTlaTpkmtuHYWfv 7qpWsfMc8gyog== Received: by gentwo.de (Postfix, from userid 1001) id 85E59B0067C; Fri, 3 Feb 2023 10:34:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 84EFEB00210; Fri, 3 Feb 2023 10:34:22 +0100 (CET) Date: Fri, 3 Feb 2023 10:34:22 +0100 (CET) From: Christoph Lameter To: Marcelo Tosatti 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 In-Reply-To: Message-ID: <5615572-974e-74cc-6c34-1de618b777cf@gentwo.de> References: <20230201195013.881721887@redhat.com> <20230201195104.460373427@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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?