Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1995294imm; Thu, 23 Aug 2018 12:17:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwd93VCqN9sjkIjCOkeGgWt0FqxlGQf507O4K9ONeK0YmdQhikIXyRBXK2CuzTkGuPO8khn X-Received: by 2002:a17:902:4403:: with SMTP id k3-v6mr58565006pld.243.1535051859842; Thu, 23 Aug 2018 12:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535051859; cv=none; d=google.com; s=arc-20160816; b=BPIp7W/3E3QB6tRlmDTylRur1o35HMyfGyc+L4ztdetdWzeIwzSeb6wn3AwERzCXkY uCXAxIBwaIIZi5AL44sJTUWs9r0XFhCTvSgk6WzpZOuOj5mtfl/ThlBVOevfjURuf0ol l00jyiLA4xLMq9Olqx4d7+xSmmj9fmEZ18SFPMi5wZiLWwtq+ClN6LvunaaW0pOXyflK W/1RD/sqc+eyhRKcCP/eHhqgOL8mgc3KQ/SBcAzQtytpzm16zIgeUJzJ6MHhGfiwvH3U nVekpk7srHA8oKo83ep3YccZSsDR0KfzSbExypRNXQuxnY1LNQgq3RE+HMnM4C9dJi+g YXyQ== 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:arc-authentication-results; bh=4SBxJqaZCJnJKZvwaOFl90wnNY1oxU/kiZ6L2VS7sQE=; b=Gn2H4ixNeBckvPwg1mKS7fWvOaDjDmoDpyOwxZ79T4OhHte3Q+y58jVDHrBHipqgax 6fIblr6seY15nrZL5IY93CGdkZu5eVxbLV+vk2oaQxb5PtEIb/aZ9AgiAkl1s53QrDLg CpoSFTgxfSxTDhWAchzaMLQpUl539aYgSoN3zlV+ibpd7g0Xsk45Wby2APk/90sQOnzp 0xp/wQGdfAjmoVs86fthNQIoZEFhtIZ+Q9qA/WF72XaQSwDX2Vdo+GaqiUJm0bProts4 XCY0pg7ry3r/nVtzw+5QYbmuh2wuS0vnjg7dGCi51PePDIxjncqLKUO7yIHigB3tplEN 3kKA== ARC-Authentication-Results: i=1; mx.google.com; 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 y4-v6si4490330pgk.583.2018.08.23.12.17.24; Thu, 23 Aug 2018 12:17:39 -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; 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 S1726556AbeHWWrU (ORCPT + 99 others); Thu, 23 Aug 2018 18:47:20 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:39165 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeHWWrU (ORCPT ); Thu, 23 Aug 2018 18:47:20 -0400 X-Originating-IP: 134.134.139.72 Received: from localhost (jfdmzpr03-ext.jf.intel.com [134.134.139.72]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A0BD560002; Thu, 23 Aug 2018 19:16:12 +0000 (UTC) Date: Thu, 23 Aug 2018 12:16:04 -0700 From: Josh Triplett To: Adam Borowski Cc: "Paul E. McKenney" , nicolas.pitre@linaro.org, linux-kernel@vger.kernel.org Subject: Re: Kernel-only deployments? Message-ID: <20180823191604.GB3243@localhost> References: <20180823174359.GA13033@linux.vnet.ibm.com> <20180823185417.y3ung3b553f2d24a@angband.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180823185417.y3ung3b553f2d24a@angband.pl> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 23, 2018 at 08:54:17PM +0200, Adam Borowski wrote: > On Thu, Aug 23, 2018 at 10:43:59AM -0700, Paul E. McKenney wrote: > > The mkinitramfs approach results in about 40MB of initrd, and dracut > > about 10MB. Most of this is completely useless for rcutorture, which > > isn't interested in mounting filesystems, opening devices, and almost > > all of the other interesting things that mkinitramfs and dracut enable. > > > > Those who know me will not be at all surprised to learn that I went > > overboard making the resulting initrd as small as possible. I started > > by throwing out everything not absolutely needed by the dash and sleep > > binaries, which got me down to about 2.5MB, 1.8MB of which was libc. > > This situation of course prompted me to create an initrd containing > > a statically linked binary named "init" and absolutely nothing else > > (not even /dev or /tmp directories), which weighs in at not quite 800KB. > > This is a great improvement over 10MB, to say nothing of 40MB, but 800KB > > for a C-language "for" loop containing nothing more than a single call to > > sleep()? > > .globl _start > .data > req: .8byte 999999999, 999999999 > .text > _start: > mov $35, %rax # syscall: nanosleep > mov $req, %rdi > xor %rsi, %rsi > syscall > jmp _start > > > as sl.s -o sl.o > ld sl.o -o init > > 'Ere you go, no libc needed. If your arch is not amd64, just say so. "pause" ($34) would also suffice, and would not require an argument or a .data section. - Josh Triplett