Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2741373pxb; Mon, 31 Jan 2022 03:21:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbjfrflFaCZdtqnsk7rYYMRgCjEEKug83sg7kntWLtsVGGyKZJLpYQmXnquGVywURq/PlH X-Received: by 2002:a05:6402:741:: with SMTP id p1mr20202475edy.394.1643628108199; Mon, 31 Jan 2022 03:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643628108; cv=none; d=google.com; s=arc-20160816; b=vZcU1YYiGdPfd77xyeUhMASHR93cWYLRbv2kFaOdcUSzT9e8JjFEXf0fm3yKb+BZ0R nWkMsR3xZD6WnEwKWkYypztTf0bGwaI5nMfVzo9mJ4EiwY0rK+eIFvtRqom6qev+2rZF v5ceOoqQfrMAQ2r0av1NH6KmOv+W9RgOkY5/pGaA5/PTB3YyhAbbxQCgq6LDJjnntmb+ VFUAYJK+8oq2T+WSTYUNF7RJotXLnp3bGxEA+WjD2uezXYGa9jJ1J1AUyfujAZJeL/tc sh9p7QvBXs87TWWhnoTSY/mLu8JJTF32yV18DPm9JDFd+zJBuXUa5Jv3h5pLr3+WMDmU MLFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RQ49Pm+NuV21ZdxRaCCTPqWR9V7O6HMPgYzi6Se2cCk=; b=ZBrLHoa/EG+Sgdq9vq62hRWdNcTCBN3aa9gZe3/hV7hltD3y31uN510wiP4c7WBIF0 AqKZmoY3IHavTuCD8Dcxz6OS0X6S9tT1H4pOCx4TAkceFjj1mcIcRl+WqnEAL9F1ILTK HE4s2LK5ZiwpfKJXbTsV3P8VhtTWfd4ibACiiudsHodRJh9T2O84rcXUPNfKIKC0UZA0 8DYI0kPglTHcSzIN8LEO50oPduwkg/PjZLrezEPl4Vl1d6vih9XhwgkFd3lfC7ltGOf5 Ja39djxGpiJYxsUVBqs63HYzTgena48C9WDMwHf5OOXfUMp5ytKDHD+t0vJb6FXqUAY+ lHmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=YMmOGsPK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sc40si7562613ejc.354.2022.01.31.03.21.23; Mon, 31 Jan 2022 03:21:48 -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=@posk.io header.s=google header.b=YMmOGsPK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350353AbiA1Q6E (ORCPT + 99 others); Fri, 28 Jan 2022 11:58:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245611AbiA1Q6D (ORCPT ); Fri, 28 Jan 2022 11:58:03 -0500 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31594C061714 for ; Fri, 28 Jan 2022 08:58:03 -0800 (PST) Received: by mail-vs1-xe35.google.com with SMTP id g10so3772603vss.1 for ; Fri, 28 Jan 2022 08:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posk.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RQ49Pm+NuV21ZdxRaCCTPqWR9V7O6HMPgYzi6Se2cCk=; b=YMmOGsPKN/42+Y8geSgWOMJpClWLqd6H1k/dnva47Y4FJqcSxZqKOSoezxMWfLmSCV QU5l9N/E/hLka91qBRtoUNzREjrVdSNWxESYfPQvlb1SXxa3esUhuGSfiqddyfBAHk8F fYg8AGyY2GB58T+yLQQre3Ng8izZdDxRIDspURJTIf+zdmhEc3L1YejetUc0VNSN5HgZ 1haR5ZaaFNezLoP8Si2/hgUTmDL2tagY10vye8EMr2VtFtuk9LeiKi+zt0x7y2Xdtilp 6q+9PHSjWoilbJDKGpaSbKIQeV6jOgpa7yIoOdftYg2OGkQok4QGZ2S2SX9uE7dlUNou +W0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RQ49Pm+NuV21ZdxRaCCTPqWR9V7O6HMPgYzi6Se2cCk=; b=4CULCuOGq92wtSMarDKfW2JRvGdQm8uiyyB8Qty1h8BBhOa/8Ao84JlMpiJZxVpKHs zYRDRbLYx7S1fcS64QO3p1rcZBpQs8X+Myf6waFMqwN9IRaqeCJhBBlpWuf0qvtn0nP+ FxOFJe3KFjht02euuxIbw6lP0qQqKaD304dmv1AURmpL6OxLiEqwDQqalVRMBnALmTTH 4lwOOBWuaqnbOnJKL5BW44splxXXVp+48kGr3Ir5WTjntPEX/FNCKKfgwrnh2kRM6OgL +ATrq8a5HvjfkGgKXlrZ0g4E7e/n9JjX8e0B8oIUFsDu+YnRJgLO5UvAjFDIs690q3+L tc1A== X-Gm-Message-State: AOAM530deGeAXSCZXx5K1EDUXEzTktGncJ/Ba/OrZUztBtFpRHpuuleG xepVsigHQkXoQWr1FUEm+g3P0nABkxWm5XN32iKn+w== X-Received: by 2002:a67:c205:: with SMTP id i5mr3971465vsj.6.1643389082319; Fri, 28 Jan 2022 08:58:02 -0800 (PST) MIME-Version: 1.0 References: <1211272108.4257.1643246572499.JavaMail.zimbra@efficios.com> In-Reply-To: <1211272108.4257.1643246572499.JavaMail.zimbra@efficios.com> From: Peter Oskolkov Date: Fri, 28 Jan 2022 08:57:53 -0800 Message-ID: Subject: Re: rseq vcpu_id ideas To: Mathieu Desnoyers Cc: Paul Turner , Peter Zijlstra , Michael Jeanson , paulmck , Boqun Feng , linux-kernel , Chris Kennelly Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 5:22 PM Mathieu Desnoyers wrote: > > Hi Paul, > > I remember our LPC discussions about your virtual cpu ids ideas, and noticed some tcmalloc code > with "prototype" fields for vcpu_id and numa node id > (https://github.com/google/tcmalloc/blob/master/tcmalloc/internal/linux_syscall_support.h#L34). > > I'm currently toying with ideas very close to vcpu_ids to solve issues with overzealous > memory allocation for LTTng-UST (user-space tracer) in use-cases where containers use few > cores. > > My current thinking is that we could use your vcpu_id idea, but apply it on a per-pid-namespace > basis rather than per-process. We may have to be clever with NUMA as well to ensure good NUMA > locality. > > Do you have any thought about this, and perhaps some prototype rseq extension code you could > share as a starting point ? We've been using rseq vcpu extensions in production for more than a year, with good results. We have a perfect use case, though: wide machines (hundreds of CPUs) with many narrow processes (restricted to a small number of CPUs). Our extension can be configured to either do a "flat" vcpu accounting, or a "per numa node" vcpu accounting. We currently only use "flat" accounting, I guess because most of our processes are affined to a single numa node. I plan to post the code to the list after the UMCG saga comes to a clear resolution. > > Thanks, > > Mathieu > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com