Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6014589pxb; Tue, 16 Feb 2021 13:39:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzdqHtbTPQcv5ucXOsUiXxA4Bh3y3Fvy47JmfMVV1ivGDFW9cy/m8//b3xJ6HJWmxYJZgI X-Received: by 2002:a05:6402:94d:: with SMTP id h13mr16046698edz.19.1613511546403; Tue, 16 Feb 2021 13:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613511546; cv=none; d=google.com; s=arc-20160816; b=wT6JijxXvvBGalAxNRWmyttoLro6a3m16DNCpB9w0GtRmkwxmIIYegr4Z1rigVmxPH vRtVWiptALCLWvxFdvWHlZkJ7SxBgp8IxEN64Z6ZjnHT4LrhfBdxjUjLay4HDGUmPGLj 6gRuBo/BS+UG7f7U1Umek3kKXruSBJT6z/D8iORsq8y9XCzRMRw2LSFyb5D+u1PUevho 0yxD6Qz3/rIOxNPnTEJBp8kN+zhBtNCyR+JRelGDzoxKox0OIfiZYJhm9D+kZfVVBtOG ALlG8rKCjyonb09X8GFPjaYSS25KJzKU6Z/ekVqOtVRIlRNiyj5JHjePHTqEVCooVo3I UxiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=W4THqvwCZrj86xY5TPeNsXOtIISm7JzhezcEESG1o28=; b=ALfng9zkPd8bDMvakmDIiNIoWWuDDWGX2Yb/RvIINe5kZQ58IvSMkttGrM+9IuKBqG BH2F5pLy3pbMM5m7bC9/ARZZ6t5eVUFLq2w02iQUuFkxmv+pI7ttjoIKLaVKAztbCldD arJLppS7dTUbYQ6DlBrCSAsXAWz/KsIu1s7Xj6OTBs2d2v/sAh7k7rY0DH2KY+zjuIJd U71QHpE5+FZzlSXSK2gELSwYZ4F+h9qP1PAl1gSJOFPQpBAOoKY7GSfwDK1Ul6nWVnjY nUqNhHgqMmQJ+mr1jgus0vX1WezrVpM+D19ZiId7vEofbHTTswtImIRVNQvQgkMde3bW MMwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tDce4dKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si15223676edb.227.2021.02.16.13.38.41; Tue, 16 Feb 2021 13:39:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tDce4dKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbhBPVgS (ORCPT + 99 others); Tue, 16 Feb 2021 16:36:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbhBPVgJ (ORCPT ); Tue, 16 Feb 2021 16:36:09 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C7EC061574 for ; Tue, 16 Feb 2021 13:35:29 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 75so3727314pgf.13 for ; Tue, 16 Feb 2021 13:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :cc:to; bh=W4THqvwCZrj86xY5TPeNsXOtIISm7JzhezcEESG1o28=; b=tDce4dKVjM97/3J8pcvVjyDXwH9d3VSUKvnjMNNscoKwqfxrPstTZzhwSKaXkni0m3 wEjGt+gqoU3zjpe+JXOK4VShoTu/+zfVTtBdyrXMm53F71oaQmxQijmKJcQlkS15fswD F2F8fwrD9E6npXQ7ZezRSHoQ/Qtqe54TAzW4lnbwCapUWlkUjp3eh21MVKSjFXLyQLLH Xo0d/QeCaIZ1Udq8ILqvEFj6ab8jTzeMHd0gjlOkS2WkVFMcAhaSWjTavXNOp5bZFv6X S1zu7qOIpkYGK1DV7jqxuPE1K6eeqWv3/cbauh+FUh8A8/5+yuzAimjc6rYUapDyE2tP dEdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:cc:to; bh=W4THqvwCZrj86xY5TPeNsXOtIISm7JzhezcEESG1o28=; b=tPkYW3DA+s6LdwgtqP8dPKZTOtLYLXbqjgYB/9jYMWSo4YcH7zC222xX522o1Xy5i+ NITFdghw5RRXQRpAGgpNm/u3Ry1TGayr9us29I6u/gjENdICJaSP/TIOUU2J/UELWQWI 9BL3CyMQZFiRXFDSqmGOVEkcZ58Xgs6mPABuJA8yvU5U8A0TRVoYRwdyYqXkf1XGcL0L HtVotx5rbIU/0u7gInnVV1o82GNDa7HZhEBIZOXR/TePtNCWgDViatKB1Q7ELTpo1/Tj k+ODzfJI6L3jai52r+ZvENCX0zqxdCg0DKlC+rcHHungru5jvCgaxvWxn//QybrzPIoJ K+RQ== X-Gm-Message-State: AOAM5334p4Cri4gd19NLn76VY3mIiOsmO+6LIcLVJC6qj2xY++2xwkb7 aE1TGvT/uOGi+cUdOlEkRj0= X-Received: by 2002:a63:844:: with SMTP id 65mr20778335pgi.371.1613511328550; Tue, 16 Feb 2021 13:35:28 -0800 (PST) Received: from [192.168.88.245] (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id p11sm4217609pjb.3.2021.02.16.13.35.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2021 13:35:27 -0800 (PST) From: Nadav Amit Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Local execution of ipi_sync_rq_state() on sync_runqueues_membarrier_state() Message-Id: <74F1E842-4A84-47BF-B6C2-5407DFDD4A4A@gmail.com> Date: Tue, 16 Feb 2021 13:35:23 -0800 Cc: LKML , Peter Zijlstra To: Mathieu Desnoyers X-Mailer: Apple Mail (2.3608.120.23.2.4) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Mathieu, While trying to find some unrelated by, something in sync_runqueues_membarrier_state() caught my eye: static int sync_runqueues_membarrier_state(struct mm_struct *mm) { if (atomic_read(&mm->mm_users) == 1 || num_online_cpus() == 1) { this_cpu_write(runqueues.membarrier_state, membarrier_state); /* * For single mm user, we can simply issue a memory barrier * after setting MEMBARRIER_STATE_GLOBAL_EXPEDITED in the * mm and in the current runqueue to guarantee that no memory * access following registration is reordered before * registration. */ smp_mb(); return 0; } [ snip ] smp_call_function_many(tmpmask, ipi_sync_rq_state, mm, 1); And ipi_sync_rq_state() does: this_cpu_write(runqueues.membarrier_state, atomic_read(&mm->membarrier_state)); So my question: are you aware smp_call_function_many() would not run ipi_sync_rq_state() on the local CPU? Is that the intention of the code? Thanks, Nadav