Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp685742pxb; Fri, 28 Jan 2022 07:59:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbR04guzam0gXK5lc7sJBG4q/nyNmWE0hAI6h+3UoulTX40x6X31ZvyC1JkoAbldDYogQ8 X-Received: by 2002:a17:902:7209:: with SMTP id ba9mr9306829plb.166.1643385581926; Fri, 28 Jan 2022 07:59:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643385581; cv=none; d=google.com; s=arc-20160816; b=XtKoMjs3oP7V3dhWJUL/jZX5bIoxatvW5q68K675mXHBmg30Utsi5GFiN3vaXZjC18 iHUym2ePF2faRoo1D+uBajVT7cGkUrChiOldF+SQCWmJ1pO3+aj5cfIbQ0NTXIhlaJnR cCK7s4QLro29AvY/dqicWQmuwdEPnLg8gUMDXgO1uBkY50mmQ28rjaFiZGenAVZt6cvt +SQaMRfZaViBrIxchJjGhFm+nTxEF0EydrNOgO/81DnzptWuARyPVy6FVA6qkt2OhCDa 2XXph1/ytmzGeTybighL5MVYVdCS83cgf/FnpoUztI6shMQgKM/6uJFdFpcdZDTvfgKP us7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=lKkvOop6NBVOz4myJcJLCtPSQ/pPLA6YNYvDUwSzWJ4=; b=plzYNJouFKDrOYz4xS2KOcQXLNE36V+Pb/m5YkihpXfI0ioi3z3axBo7HbSR7PKgov punRN7FQRlCCXucwLJfVvMJkOO0avWLxTZ5eOcJ9I5iWm0PVQq+8VtKprEjg8dEXP1q2 mSMQTGv3D8YRRg1jtktPzYNTch0as17AJZuJCFOxlaTXM9/FdGyeWS/EyCUZbyocvD4L YVBELgYJhXNR54ZXgu2j/RagXf0pdYW3w9zZRWjo5+Lz0fQkYvFGKCYgo9ygfYqNtBn/ stCyHMnN33qlZSa/DsotLHcK3QeWR0tstEZUEdx2TfiAitGKuYU8G2bAtdqejCvl6Mk/ fXcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ql3pdQZq; 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=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pf6si3469480pjb.77.2022.01.28.07.59.14; Fri, 28 Jan 2022 07:59:41 -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=@linux.dev header.s=key1 header.b=ql3pdQZq; 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=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237163AbiA0SrU (ORCPT + 99 others); Thu, 27 Jan 2022 13:47:20 -0500 Received: from out0.migadu.com ([94.23.1.103]:15157 "EHLO out0.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbiA0SrN (ORCPT ); Thu, 27 Jan 2022 13:47:13 -0500 Date: Fri, 28 Jan 2022 02:47:08 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1643309232; 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=lKkvOop6NBVOz4myJcJLCtPSQ/pPLA6YNYvDUwSzWJ4=; b=ql3pdQZqzgSNQx7urPCbVYqgUhXgY2dDoca6ITOB9uk7Z7y+jziWdFN+HH4EctHL2OotPO xCEg5xYnWPXObr6N0yZInYF0yhqhfK2V3Gm87xbMOHQcY7eDUR5MSeySAvcFvvI7zyuh1G fj9JxF6CRWX27HJ/xEU1aEciWim9ryE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Tao Zhou To: Peter Zijlstra Cc: mingo@redhat.com, tglx@linutronix.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, x86@kernel.org, pjt@google.com, posk@google.com, avagin@google.com, jannh@google.com, tdelisle@uwaterloo.ca, mark.rutland@arm.com, posk@posk.io, Tao Zhou Subject: Re: [RFC][PATCH v2 5/5] sched: User Mode Concurency Groups Message-ID: References: <20220120155517.066795336@infradead.org> <20220120160822.914418096@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 01:25:36PM +0100, Peter Zijlstra wrote: > On Mon, Jan 24, 2022 at 10:46:17PM +0800, Tao Zhou wrote: > > > > +/* Called from syscall exit path and exceptions that can schedule */ > > > +void umcg_sys_exit(struct pt_regs *regs) > > > +{ > > > + struct task_struct *tsk = current; > > > + long syscall = syscall_get_nr(tsk, regs); > > > + > > > + if (syscall == __NR_umcg_wait || > > > + syscall == __NR_umcg_ctl) > > > + return; > > > + > > > + if (tsk->umcg_server) { > > > + /* > > > + * Didn't block, we done. > > > + */ > > > + umcg_unpin_pages(); > > > + return; > > > + } > > > + > > > + umcg_unblock_and_wait(); > > > > umcg_unblock_and_wait() -> umcg_enqueue_and_wake() -> > > umcg_wake_server() -> umcg_wake_task(tsk->umcg_server, ...) > > > > tsk->umcg_server is NULL here and umcg_wake_task() use it to update > > state in umcg_update_state(NULL, ...), that means tsk->umcg_clock > > will happen something i do not know. > > I think umcg_unblock_and_wait() will repin, at which point we should > have tsk->umcg_server again. That's right, I miss that. > > There are two places to call umcg_unblock_and_wait(). One is in > > umcg_register() where the server is set. Another one is in > > umcg_sys_exit() where the server is not set. May use a bool to > > indicate if the server is set. > > I'm not sure what you're on about, but I absolutely hate redundant > state, that only leads to problems. But, it's my noise though.