Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1265309rdb; Fri, 1 Dec 2023 11:09:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0DY/C+miFB5wmHoUDkEnpW36mMmycDZ3lw+gQtJ2+SK/YVo66gqfiQdvGAJo5bIHNLRqI X-Received: by 2002:a17:902:e5cb:b0:1d0:5a9d:6eb9 with SMTP id u11-20020a170902e5cb00b001d05a9d6eb9mr39662plf.51.1701457755509; Fri, 01 Dec 2023 11:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701457755; cv=none; d=google.com; s=arc-20160816; b=sVbgRX75FtyznyeidrXnv4+uLmTmwYOCTiEHwdYd5AaKSVA5g6xd5Z4X+7RbgZ14NV S4wy2jhDZYabxt2ynFw4+TofBwJ5JQc2FtZO/rswHJxObiaWeJHF8x0xFvi4JWOPGeHv nSb42uxhwYOaxhTmxORGdH/t9je56ic9lL/xQ176uAXKlYYCsgLRT0TPDfdgsCu3LlYv yFb7QNCG6pcNoMhCT5PjezN+f5lWxdtttAgy8vV1AVKy5Ab6XohEH8gzzO2w0lBOk9WU nwFRczVfw/EFEIrJ0d5mDxaD1AUXQkxQWls1bI3zy2kO12Uf8O3ZMoY8BQ2gi6l/vOBw gT7w== 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:date:dkim-signature; bh=4Ov7ZYt6f9Ld4mPIlaT6U5Z/XG9bgW8ya/uFK02NgSc=; fh=AWx7WiAu1YtoFDEQsbXVTpt32eJyMRQC172/h3m5wu8=; b=UN+m7Mcjw+kqHzeAoV8hyIBO5RuKOpPez/6tpkdawoyL6SSJ631xYiFfTJ82Aane9L vng1VYB7QG6xbfmHb7INTPh5Z+Xe5UnioOPDw2SdZqpstHuIiuZAELm6geBJgTcwuDQT eGQtOOK7H8fdMlHIMa8iCdb4JTYYdTGF7/2JH7qW7n4JMELcC9tLOMnNdu/J3Gy54V5b sSxq4aIDZHaaZu0LE0LEClu99UnMr1mIgKT72CEm2AWE2V0HeDpVF6OZgm+ca6MTXvKw G9bzx7nlVFvjtTm9L6FSVE0bzxr286zv4sElSkLWJV3z0nK59MHXLE3OGcB5qqzzzB7o vlog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uk+N8e9B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e18-20020a17090301d200b001cfe0129fcbsi3876892plh.139.2023.12.01.11.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 11:09:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uk+N8e9B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 81C0D812DBF4; Fri, 1 Dec 2023 11:09:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379446AbjLATI7 (ORCPT + 99 others); Fri, 1 Dec 2023 14:08:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379443AbjLATI6 (ORCPT ); Fri, 1 Dec 2023 14:08:58 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC7FD63 for ; Fri, 1 Dec 2023 11:09:04 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82AC3C433C8; Fri, 1 Dec 2023 19:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701457744; bh=gfAKpxTJr88+nH/VYuHmnmVgmXh+i5LB/OHeGQr5JjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uk+N8e9BxrNW/+0NPefP+KTXN1tRzsSxKjbX3222yyJTHsp0Qiwq/dHiIYeLFW4Wa vW2o9uokp1Z6s0yhTTd6Bl45P4byEoHtxTn1lLh1Mzp5U7A8ffByJUoClDe9MqYp7M cgPr4a7BKx+t1zFIbce8PzdpV0aWff3t4Mzi0W9Wxdl5NR+o30RVS5v2eGfAXxchYo 96qAtdyPXpe62P4fCgJjhYN5KXRfassQS8OXs7f08EY2WuKT7ZI3NR1YjS2g6/0g25 XNoPybkWKotiBFJr3qmGCYAVIiw3uHKIao9gLzPJIJN6HaZDnCFVoZVCfHUq1bgWXN GRiQdEYKwfHTg== Date: Fri, 1 Dec 2023 11:08:41 -0800 From: Josh Poimboeuf To: Peter Zijlstra Cc: Mathieu Desnoyers , rostedt , "Masami Hiramatsu (Google)" , Indu Bhagat , "carlos@redhat.com" , Josh Poimboeuf , "Jose E. Marchesi" , Mark Rutland , Brian Robbins , Diamon discuss , linux-kernel Subject: Re: Summary of discussion following LPC2023 sframe talk Message-ID: <20231201190841.z5flmsmzectrlrew@treble> References: <20231115154912.GC8262@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231115154912.GC8262@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 11:09:08 -0800 (PST) On Wed, Nov 15, 2023 at 04:49:12PM +0100, Peter Zijlstra wrote: > > - JITs: > > > > - There are two approaches to skip over JITted code stacks: > > > > - If the jitted code has frame pointers, then use this. > > > > - If we figure out that some JITs do not have frame pointers, then > > we would need to design a new kernel ABI that would allow JITs > > to express sframe-alike information. This will need to be designed > > with the input of JIT communities because some of them are likely > > not psABI compliant (e.g. lua has a separate stack). > > Why a new interface? They can use the same prctl() as above. Here text, > there sframe. Our thinking was that a syscall defeats the point of "just in time". > > - 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? Yes, assuming the JIT doesn't mind doing a syscall. > > - We may have to create frame description areas which content are specific to given > > JITs. For instance, the frame descriptions for a lua JIT on x86-64 may not follow > > the x86-64 regular psABI. > > > > - As an initial stage, we can focus on handling the sframe section for executable > > and shared objects, and use frame pointers to skip over JITted code if available. > > The goal here is to show the usefulness of this kind of information so we get > > the interest/collaboration needed to get the relevant input from JIT communities > > as we design the proper ABI for handling JIT frames. > > As per: https://realpython.com/python312-perf-profiler/ > > There is some 'demand' for all this, might be useful to contact some JIT > authors and have them detail their needs or something. If there's no sframe then we can just fall back to frame pointers like ORC does. And that article recommends enabling frame pointers for python. Between that and prctl(), it may be enough. -- Josh