Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4144198rwb; Tue, 8 Nov 2022 12:45:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM4L+Hzgp67hmSTcJcBtziRYWAIKyhNd8Vj4QjzHeNWdDitE0bpwewsfT2Sr4OgR4EK1SWCr X-Received: by 2002:aa7:df94:0:b0:461:aff8:d3e1 with SMTP id b20-20020aa7df94000000b00461aff8d3e1mr58288499edy.10.1667940329545; Tue, 08 Nov 2022 12:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667940329; cv=none; d=google.com; s=arc-20160816; b=tgL2sM+9DsI162ijGdi0bE1RQDYFpWNpGuvSScq70JAV8PICCu8e/ZP7etLfI5F2PI yELH9RyqySfgZV7JJDXxE1Cl8XRcOeA0uINxvQk76+vH1pkNIRKohxE9GbVjsK98ZwlM ez8ZFx0T20qjY/F50ni62AogwtzmADnuWs07VLuHeMbhPU2bGVKVY5Vez4PqqTS7N9AR BzY0mUROmcukyFKPiPcQONGFjq/v0xxSRggonEAkeYMVMLpqMkPi1BCQfqr3ApG8xf2v 4zQ6lRkU2lUzudpnWkDMU582dW/br1SNPVp7PjN6VFqnE9C9KLfHuoKw4px+8wGwZCWl p4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5V0+YJP+R5FmlqlQWJwf+Aaf4+CMOZkGji/FcD3paAI=; b=d2xCT1SJPyznL+dkH8918F9mVTSimm7d8gtGL2+/WZDTEJHLwBrvSSo7SNQTvVtxJc XdfVwmLnG7xMAtiTNKALqmH0KZI5lb40CJPLG4/U4lNRm7346s92yt7lifvYumY5NZcC X+gT1emVub2p3hT/DZRHfpF0eRXPrsRy1j3kDfqVl12wC6tiRItglKp8JtD/uPWEeLBq kmclLT7+6r4BCKPYNyDYEAYkVDq6nWgZF9IXr+hon2Or/RIDkDDAvZBbLbfq4rFWfZsa 1IDqTdP8g7WXbOiW9dz0P9i92LrEO4pyIV1SjIr8OF1/4dYD23DNMsp6ZRCtVfHc40vc O45g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=k3iNJAuK; 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=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a056402274200b0045d06ea5596si17873920edd.26.2022.11.08.12.45.07; Tue, 08 Nov 2022 12:45:29 -0800 (PST) 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=@efficios.com header.s=smtpout1 header.b=k3iNJAuK; 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=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbiKHTpZ (ORCPT + 91 others); Tue, 8 Nov 2022 14:45:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiKHTpV (ORCPT ); Tue, 8 Nov 2022 14:45:21 -0500 Received: from smtpout.efficios.com (smtpout.efficios.com [IPv6:2607:5300:203:5aae::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 519D31D654; Tue, 8 Nov 2022 11:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1667936717; bh=N9FGx501778vNVrOHYv7pAKWQyx42YqgfZDZQz7Kpgk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=k3iNJAuKTFU1zCZs/molOCmMlgz/rjg/gx2J96nBs8Qmowxl5/5/XbzmM8ddiN31j HH4vY1V+Uxx11sHIUyU0mRQmfs0aMLSZ5a/hDbv13H4spU7VQ8qf8+L/eIZWvDnQ6N gZlzjsswfTAW1xCXAv7yESvj2OK11CO1cnMXGS9n2glgaqwBEkIBADosDHvorRPBwl nf+qFoDKxJndZCKSQczBv5XFZUTh3oSyQyJxyTvL1kBrAuE05fxgs5r+fvXxkMOCp1 QER9Qns99zg8tw80p/vMPMxUTTon9pMOpqjOGnuM1kh53FKdiK+OBDXP+4MLO/tg01 RlnUMNIryPV9Q== Received: from [172.16.0.153] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4N6JV51LvbzgHZ; Tue, 8 Nov 2022 14:45:17 -0500 (EST) Message-ID: <916c7a1f-fddd-77d6-6f91-6d3c196e1d86@efficios.com> Date: Tue, 8 Nov 2022 14:45:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v5 08/24] sched: Introduce per memory space current virtual cpu id Content-Language: en-US To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , "Paul E . McKenney" , Boqun Feng , "H . Peter Anvin" , Paul Turner , linux-api@vger.kernel.org, Christian Brauner , Florian Weimer , David.Laight@aculab.com, carlos@redhat.com, Peter Oskolkov , Alexander Mikhalitsyn , Chris Kennelly References: <20221103200359.328736-1-mathieu.desnoyers@efficios.com> <20221103200359.328736-9-mathieu.desnoyers@efficios.com> From: Mathieu Desnoyers In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS 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 2022-11-08 08:00, Peter Zijlstra wrote: > On Thu, Nov 03, 2022 at 04:03:43PM -0400, Mathieu Desnoyers wrote: > >> diff --git a/fs/exec.c b/fs/exec.c >> index 349a5da91efe..93eb88f4053b 100644 >> --- a/fs/exec.c >> +++ b/fs/exec.c >> @@ -1013,6 +1013,9 @@ static int exec_mmap(struct mm_struct *mm) >> tsk->active_mm = mm; >> tsk->mm = mm; >> lru_gen_add_mm(mm); >> + mm_init_vcpu_lock(mm); >> + mm_init_vcpumask(mm); >> + mm_init_node_vcpumask(mm); >> /* >> * This prevents preemption while active_mm is being loaded and >> * it and mm are being updated, which could cause problems for > >> @@ -1150,6 +1154,9 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p, >> >> mm->user_ns = get_user_ns(user_ns); >> lru_gen_init_mm(mm); >> + mm_init_vcpu_lock(mm); >> + mm_init_vcpumask(mm); >> + mm_init_node_vcpumask(mm); >> return mm; >> >> fail_nocontext: > > Why isn't all that a single mm_init_vcpu(mm) or something ? Good point, I'll update that. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com