Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3361334yba; Tue, 16 Apr 2019 09:47:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8v0hkjiNuYN8Vtrc1O3rmnCXzL1lvssS/cXTPb5iadltdD/Y5095SOyhdNpgYWFbfwi3z X-Received: by 2002:a63:ed4e:: with SMTP id m14mr78473066pgk.182.1555433258720; Tue, 16 Apr 2019 09:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555433258; cv=none; d=google.com; s=arc-20160816; b=GN17M6EybKmvZDWnOH83xRDewtqa/2HxvpA5cjYF0e9BQ9KFaRxTzhnVyZy+sfi1F5 K9q+HpNQN638FksQUfoMAwFMSaLAq9yF8NeNBYAOz6tGTxC7G/m5K/I5Fdi+jwf+TSIz 04aU7MzQHORiGxE7HUQdtNTswvuIzIrl7kx7AjLcMtfMftGYqwMFxuuilPBX71+eFlDX uQ6ccU2GUy8S9XvCfFS59j06+8/o+T/jmolBYQcodxqvzIDknVxEuwX5YnMNLfU3a4Tm ZJl4cMRp56vM/9llcWt7i98AsS1tszGo1Ra3LhrmgARFQDnkW0rJ5KbLww63ROZE89Ky P5DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tsRRbr6q8xRXitr55R13RaRnWMNI10aBLSKNBEpEchc=; b=jAbMGxRq7WIGt6inl88l7kxFPqrHSuc+ebVpZfS/UVaarU7awQ/bvJDJkEWS2mBN/o 5b/WmfH/YrmSJsX/y7tDkrz548Qenb2HHsbWCSTTbePSGUM2cwmmSAlj725KHVgwHeF3 rXdllHQBTrumZupyGQ8eWgcYczDTTG4RqRJ0eG8sZ8MSybowEU61OvZQbVOh9KjruUzl sc4uvbMBSkfBfGyDQKAJ4vnVY1Z60L+8zSnMs0k+KshYnMx61jWoDxGHGMgnR7sVkKXL XpOb816ziKrVp4GX5RYYSKqUSF0yHMkzBlqpEPVZv6/qXP/iAubvPgtCwVi8SitNN4jn Y3ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bNr3ipc+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si45176133plr.17.2019.04.16.09.47.22; Tue, 16 Apr 2019 09:47:38 -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=@gmail.com header.s=20161025 header.b=bNr3ipc+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729633AbfDPQqt (ORCPT + 99 others); Tue, 16 Apr 2019 12:46:49 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:42658 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbfDPQqs (ORCPT ); Tue, 16 Apr 2019 12:46:48 -0400 Received: by mail-pl1-f193.google.com with SMTP id cv12so10629845plb.9; Tue, 16 Apr 2019 09:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tsRRbr6q8xRXitr55R13RaRnWMNI10aBLSKNBEpEchc=; b=bNr3ipc+CTaD4tGwxY593FZ31O0Q+j30oQunL6fN8Vg0xCvAYTGAxMwgcM1dx/yFiQ oTEP218jHO8Bh/SJrnsLp+RLHMFHpGDZ2sAhk4s5lrnEFd4bEhOdzK9BBEsC00gTv/uK f0UPbPgI8yfgcdY2frZaz3Da+5lJrbMl1s9/ipTk2kUPr/2ACbJKu6S591w4v7cVg+/G FqmZDUWsBY4E0rsIV81PUtAlklcD/JPtgIDebrWF6VDuxB3L4aJC1JqFoFkS+DeeZpU+ nbtDmpZqvNOKIE1c0PrkvwxSncnbgoH46Q+rQXjeq8XF8E+m24vWux1IvBhBoDM05yCw 2DYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tsRRbr6q8xRXitr55R13RaRnWMNI10aBLSKNBEpEchc=; b=YPlQop5wzVUcD7iE7ODAT1NX9MlfF8PxLb2YhuGu8yLvxHumLA1ujesF9ri1OcSwXr NkAdefbh0tXUfIVK94lpPGsfIoSwyMJEc1wmddzvRPa8Ct2Mb4snaCNIhWEpgCxIbOgP wdtAGZPC0UVeExSHjm/cDyiSncEaQTh1bvFTFasYwuNPYoBnAbgaaQIJBXy8SOJjicER h9/T1s21XEvXZ8G3XZ0RoULcy1T2c8BHJuVE5SxEYIJ7kpcQGhz9R3d4nRXh1DyyIXJL WJ3TSMuHzfFmfokzAYB4Ua/0Jmj3UwaVr8zKTuxdpYDf2iZn3fRIW4fEwZj72UIGrBdZ jkDg== X-Gm-Message-State: APjAAAX5ZgcXOi+8xT0G+PMVz/oUV1/gtV/hm2TnR+aAGO3wwzdsLbkc 8cdjm9OtjRK+gqOITi4bEx8= X-Received: by 2002:a17:902:2965:: with SMTP id g92mr66980230plb.267.1555433206864; Tue, 16 Apr 2019 09:46:46 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:200::1:601e]) by smtp.gmail.com with ESMTPSA id x16sm121234803pge.27.2019.04.16.09.46.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 09:46:45 -0700 (PDT) Date: Tue, 16 Apr 2019 09:46:44 -0700 From: Alexei Starovoitov To: Greg Kroah-Hartman Cc: Steven Rostedt , Karim Yaghmour , Joel Fernandes , Kees Cook , Olof Johansson , Joel Fernandes , Linux Kernel Mailing List , Qais Yousef , Dietmar Eggemann , Manoj Rao , Andrew Morton , Alexei Starovoitov , atish patra , Daniel Colascione , Dan Williams , Guenter Roeck , Jonathan Corbet , Android Kernel Team , "open list:DOCUMENTATION" , "open list:KERNEL SELFTEST FRAMEWORK" , linux-trace-devel@vger.kernel.org, Masahiro Yamada , Masami Hiramatsu , Randy Dunlap , Shuah Khan , Yonghong Song Subject: Re: [PATCH v5 1/3] Provide in-kernel headers to make extending kernel easier Message-ID: <20190416164642.krptlz32zusr4pgn@ast-mbp.dhcp.thefacebook.com> References: <20190411031540.ehezr6kq7ouobpzx@ast-mbp.dhcp.thefacebook.com> <20190415104109.64d914f3@gandalf.local.home> <20190416083306.5646a687@gandalf.local.home> <20190416124939.GB6027@kroah.com> <20190416130440.GA7944@localhost> <20190416094509.1af6326b@gandalf.local.home> <20190416142240.GA31920@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416142240.GA31920@kroah.com> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 16, 2019 at 04:22:40PM +0200, Greg Kroah-Hartman wrote: > On Tue, Apr 16, 2019 at 09:45:09AM -0400, Steven Rostedt wrote: > > On Tue, 16 Apr 2019 09:32:37 -0400 > > Karim Yaghmour wrote: > > > > > >>> Then we should perhaps make a new file system call tarballs ;-) > > > >>> > > > >>> /sys/kernel/tarballs/ > > > >>> > > > >>> and place everything there. That way it removes it from /proc (which is > > > >>> the worse place for that) and also makes it something other than debug. > > > >>> That's what I did for tracefs. > > > >> > > > >> As horrible as that suggestion is, it does kind of make sense :) > > > >> > > > >> We can't put this in debugfs as that's only for debugging and systems > > > >> should never have that mounted for normal operations (users want to > > > >> build ebpf programs), and /proc really should be for processes but that > > > >> horse is long left the barn. > > > >> > > > >> But, I'm willing to consider putting this either in a system-fs-like > > > >> filesystem, or just in sysfs itself, we do have /sys/kernel/ to play > > > >> around in if the main objection is that we should not be cluttering up > > > >> /proc with stuff like this. > > > >> > > > > > > > > I am ok with the suggestion of /sys/kernel for the archive. That also seems > > > > to fit well with the idea that the headers are kernel related and probably > > > > belong here more strictly speaking, than /proc. > > > > > > This makes sense. And if it alleviates concerns regarding extending > > > /proc ABIs then might as well switch to this. > > > > > > Olof, what do you think of this? > > > > BTW, the name "tarballs" was kind of a joke. Probably should come up > > with a better name. Although, I'm fine with tarballsfs ;-) > > No need to have this be a separate filesystem, we can use a binary sysfs > file in /sys/kernel/ for this as the kernel is not doing any "parsing" > of the data, it is just dumping it out to userspace. What folks keep saying that an fs of header files is easier to use than tarball from bcc and cleaner from architectural pov. That's not the case. From bcc side I'd rather have a single precompiled headers blob that I can feed into clang and improve bpf program compilation time. Having a set of headers is a step to generate such .pch file, but once generated the headers can be removed from fs and kheaders module unloaded. The sequence is: bcc checks standard /lib/module location, if not there loads kheader mod, extracts into known location, and unloads. The extraced headers are in plain fs cache and will be evicted from memory when bcc is done compiling progs. imo much cleaner than kernel maintaining headers-fs and wasting memory. Where kheaders.tar.xz is placed doesn't really matter. /proc or /sys/kernel makes no real difference.