Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1527941yba; Sun, 14 Apr 2019 12:40:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxhXZPgeqPXR2Sp25l4Cbpza7+quJelb40nohG6aHOUgIPXHIX/E55sg75BfPbVwxvSrca X-Received: by 2002:a62:6490:: with SMTP id y138mr70852607pfb.230.1555270819486; Sun, 14 Apr 2019 12:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555270819; cv=none; d=google.com; s=arc-20160816; b=V2TafIMXIZzK8qd/+Q2HEFlqcU3frVTCDaXMvOXncteUNOcyFtKsEgyLZRDXBWJ0pX 2ysXPA/fXygX52m63Lcv5mqEYYHP4lNJ1mocLC5aZs6TjGyP7HVTcHwJmTle7vdIoiZk 6+Qbv/k1wgOdLzhaIm135K6xaTFFsmUELucf6YbV4TXAMxeyBenbZ6JRmNBXwf4COZYS lkaS85LliYWbTQNhKssKFVMfDhlU8+4IctBWXw14iwW9KCjJPREAA2RXW5SuOP+rpVoM wgHoEAPiADE465/7Dbp6EjEp6RaxvsxbgkRgzWCi/3wam27+xXLE04qrTrl6ZqGimOgc 9Jmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QOWtsughs8v5wa64yJxww8mtNQrcGzXPVL4jTOgzC/c=; b=BbLk3k8Mlf924TyFH5dE/4Efrhn9526y/u376f9notXkTgYR5ddL4XxPyHqaKbegWB Y4h6MDDUqyCuuBeu2ZUg9BwetHNYtHBprh3dfSHL132xwrb+7ZUNVwTFzJ4GaEGb18ym oUGj3lPGsjfVgG1cWueT6BHfmjfTWeDP4Ehg45c9r1ogABTKX44wv3apoUEthoh+XZAy iqRM7uYaTc/zelWLG9hAhUjSIhD4gLYW2wAUHwXQNq6JcE0GD9UX9FKDtZ2IFmis4GfU 0yLVGE6UHifr5LkZ8oqKDrwgqkeQwB2riXRD13XkG6EDSdfjLlVFAbm1uOS2aoFXD+c7 yFfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=WDfzNPNq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y204si39590598pfb.184.2019.04.14.12.39.47; Sun, 14 Apr 2019 12:40:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=WDfzNPNq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726415AbfDNTir (ORCPT + 99 others); Sun, 14 Apr 2019 15:38:47 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:50876 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbfDNTir (ORCPT ); Sun, 14 Apr 2019 15:38:47 -0400 Received: by mail-it1-f193.google.com with SMTP id q14so8732569itk.0 for ; Sun, 14 Apr 2019 12:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QOWtsughs8v5wa64yJxww8mtNQrcGzXPVL4jTOgzC/c=; b=WDfzNPNq7XXUT+Vy97HPWh3UDNOGkcsiWIi4/1mGI47OsfGj/aBaJ0V5eP3WoLkFUm Okq47hXhs9TB71pWkv9Z3Uq1ogtTvwdoOPn/2In/Mo0ZHLwkDmqMiulDWXCxW9p9w3jK yNHQEgxW5nRBrKL3q02Dy1ki9B97+Po5aqDlcQuYRck+cKUYpA+XiKag5N/uTbiR6isX 4elBNcmJSATa2N3hIifcyWnY7iCZyrxbO5mdH99IPwzy8V5YjYLjgdWyYyfIdItvu7Ac 8rQbBKPtcGOcUzjRl1CiE+lIQBYppRfBgpHNLEQ6ykvJiFnYV3yCkiSPMXvZbYMZFYgz AHSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QOWtsughs8v5wa64yJxww8mtNQrcGzXPVL4jTOgzC/c=; b=ru4JYyLeE51ecIYtCOmV32VQvHRuvhk3ExiPnUSUDxRhvbO0adk6qDUH91ykStlmsx d+cL8sFf42giZZrNChG7s5Pyv6XqwMnou8VufKHl8Gi95OzBX7QapBWkwuQe9AYfJDRE vjrBX+c+zlRD/zNruhaYi+XMF4MdWIGuvPRFUTpn/Z8NXVv/DMWNBBud9M5r3eJsvQmY /ZFe+Zljasr354tY8a4GaXBpV05hYXq60rA9KAETWesAQkWiWYcJakXWgswu4j2pIJmI yNt5gxl9lcjVKKQfCja31KORDKQEDld6XXtlLdlTEFy4m9oBTJTt7WzVT1t+DaE4+oXQ u4HA== X-Gm-Message-State: APjAAAWBuPEoG4BhVcYTDlVN0hyjY/2nGZx1Dyqzx1jHKOaXathriqs2 y6CgdOKkLjtpf4yajaWf8qpnSoqDSjtGf78eiWfl2g== X-Received: by 2002:a02:c7c8:: with SMTP id s8mr48885831jao.13.1555270726209; Sun, 14 Apr 2019 12:38:46 -0700 (PDT) MIME-Version: 1.0 References: <20190320163116.39275-1-joel@joelfernandes.org> <20190408203601.GF133872@google.com> <20190411031540.ehezr6kq7ouobpzx@ast-mbp.dhcp.thefacebook.com> In-Reply-To: <20190411031540.ehezr6kq7ouobpzx@ast-mbp.dhcp.thefacebook.com> From: Olof Johansson Date: Sun, 14 Apr 2019 12:38:34 -0700 Message-ID: Subject: Re: [PATCH v5 1/3] Provide in-kernel headers to make extending kernel easier To: Alexei Starovoitov Cc: Joel Fernandes , Joel Fernandes , Linux Kernel Mailing List , Qais Yousef , Dietmar Eggemann , Manoj Rao , Andrew Morton , Alexei Starovoitov , atish patra , Daniel Colascione , Dan Williams , Greg Kroah-Hartman , Guenter Roeck , Jonathan Corbet , Karim Yaghmour , Kees Cook , Android Kernel Team , "open list:DOCUMENTATION" , "open list:KERNEL SELFTEST FRAMEWORK" , linux-trace-devel@vger.kernel.org, Masahiro Yamada , Masami Hiramatsu , Randy Dunlap , Steven Rostedt , Shuah Khan , Yonghong Song Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 10, 2019 at 8:15 PM Alexei Starovoitov wrote: > > On Wed, Apr 10, 2019 at 09:34:49AM -0700, Olof Johansson wrote: > > On Wed, Apr 10, 2019 at 8:51 AM Joel Fernandes wrote: > > > > > > On Wed, Apr 10, 2019 at 11:07 AM Olof Johansson wrote: > > > [snip] > > > > > > Wouldn't it be more convenient to provide it in a standardized format > > > > > > such that you won't have to take an additional step, and always have > > > > > > This is that form IMO. > ... > > Compared to: > > - Extract tarball > > - Build and load > > - Remove file tree from filesystem > > I think there are too many assumptions in this thread in regard to what > is more convenient for user space. > I think bcc should try to avoid extracting tarball into file system. > For example libbcc can uncompress kheader.tar.xz into virtual file system > of clang front-end. It's more or less std::map > with key=path, value=content of the file. Access to such in-memory > 'files' is obviously faster than doing open/read syscalls. I think performance is a red herring, especially since you have to uncompress it on every compiler invocation. With this you'd need to read/touch/write _all_ header files, not just the one your current compiler invocation will use. In the grand scheme of things, open/mmap syscalls wouldn't necessarily be slower. > bcc already uses this approach for some bcc internal 'files' that > it passes to clang during compilation. > All of /proc/kheaders.tar.xz files can be passed the same way > without extracting them into real file system. This is now a circular argument. Joel was stating that the plain text headers took up too much memory, but now it's preferred to create such filesystem in userspace memory on *every compiler invocation*? That's... not better. And definitely worse if you want to compile in parallel. From my perspective, this is where we're at: This patch seems to have been met with a lot of responses in the tone of "this is not an appealing solution". Meanwhile, some of the suggested alternative solutions have not worked out, and we are now at a point where there's less interest in exploring alternatives and arguments to merge as-is with only minor adjustments. I understand the desire to solve this. It'd be really convenient to have a way to runtime build against the same structure layouts that the kernel was built with. But I haven't heard anyone say that they *like* the solution proposed, and I haven't seen many of those expressing concerns being converted to support it. Usually what we do at times like this is that we say "Yeah, this is a problem that should be solved, but this solution doesn't seem to be the right one and we would need to maintain it forever as part of the ABI. Let's wait until a better solution is found." With time, sometimes a better solution becomes obvious, or circumstances change enough to allow for some different approach, or someone has a new idea from a different perspective that solves the same problem. All of that being said, I don't have veto rights on code going into the kernel, even if I think picking up this patch would be the wrong thing to do. I'd be a *lot* less hesitant if this went into debugfs or another location than /proc, which is one of the most regression-sensitive interfaces we have in the kernel. > Joel, would be great if you can share corresponding bcc patch > that takes advantage of /proc/kheaders -Olof