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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DBCAC07E97 for ; Fri, 1 Dec 2023 19:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379540AbjLATrW (ORCPT ); Fri, 1 Dec 2023 14:47:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379522AbjLATrV (ORCPT ); Fri, 1 Dec 2023 14:47:21 -0500 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23D8E128 for ; Fri, 1 Dec 2023 11:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1701460043; bh=foA2StCe+zumNr+evTpB9NCVEmf//UE2RjTnry8IR+4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jCrDZGli1l5kneFcuBCFiY8Kp4yd5dwcjj58G2BMpPRCIyZjuI8BnCb60vAztvp8t AmqtBuvSuvrDDtdIyrQaFf+hEktGnGsw9PXT4lM7ZnPBoK8rRnRVjsdBCzLPqDLM1p X8/ecRsigTZNAPoRH+wtOBQ/C3c+SDvdxGgcf1nkdc16fk1ahW2nhh8p/SLzYcqoxr 5KuhUXaOrnlpcNWnF2XiM865kKm1jRCBzAPtyhzz3SJclCvNNhlTlXvIKsZNBzili5 YyiiE2eWXOGbVSxE8nEcz44mTVzo8rz4v6Q/pCMPpjPoRqjoi5STEm6qwN0mgdg7GK qzDIHJ4xIffww== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Shk9R4FQjz1fB5; Fri, 1 Dec 2023 14:47:23 -0500 (EST) Message-ID: <462218f5-ff1a-4051-ad22-f9de633696e3@efficios.com> Date: Fri, 1 Dec 2023 14:47:23 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Summary of discussion following LPC2023 sframe talk Content-Language: en-US To: Peter Zijlstra Cc: rostedt , "Masami Hiramatsu (Google)" , Indu Bhagat , "carlos@redhat.com" , Josh Poimboeuf , "Jose E. Marchesi" , Mark Rutland , Brian Robbins , Diamon discuss , linux-kernel References: <20231115154912.GC8262@noisy.programming.kicks-ass.net> From: Mathieu Desnoyers In-Reply-To: <20231115154912.GC8262@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-11-15 10:49, Peter Zijlstra wrote: > On Wed, Nov 15, 2023 at 10:09:16AM -0500, Mathieu Desnoyers wrote: [...] > >> - When we have a good understanding of the JIT requirements in terms >> of frame description content, the other element that would need to >> be solved is how to allow JITs to emit frame data in a data structure >> that can expand. We may need something like a reserved memory area, with >> a counter of the number of elements which is used to synchronize communication >> between the JITs (producer) and kernel (consumer). > > Again, huh?! Expand? Typical JIT has the normal epoch like approach to > text generation, have N>1 text windows, JIT into one until full, once > full, copy all still active crap into second window, induce grace period > and wipe first window, rince-repeat. > > Just have a sframe thing per window and expand the definition of 'full' > to be either text of sframe window is full and everything should just > work, no? Is the generated text reachable (for execution) before the end of the window during which it was created, or is there some kind of epoch delay between text generation and the moment where it becomes reachable ? If there is a delay between code generation and the moment where it becomes reachable (e.g. a whole epoch), then I understand your point that we could consider the whole jitted text window as belonging to a single sframe section and register it in one go to the kernel. The overhead of the system call would be amortized over the epoch duration. However, if JITs are allowed to incrementally add text to the current window and make it immediately reachable, then we need to have some way to synchronize appending "sframe functions" into a memory mapping that do not require issuing a system call every time a new function is jitted. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com