From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8522ECE58C for ; Tue, 8 Oct 2019 01:15:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 15F0B20867 for ; Tue, 8 Oct 2019 01:15:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=garybgenett-net.20150623.gappssmtp.com header.i=@garybgenett-net.20150623.gappssmtp.com header.b="Ci5s5I6f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15F0B20867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=garybgenett.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A5B228E0006; Mon, 7 Oct 2019 21:15:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A0B4C8E0003; Mon, 7 Oct 2019 21:15:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D21E8E0006; Mon, 7 Oct 2019 21:15:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 676288E0003 for ; Mon, 7 Oct 2019 21:15:40 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 167BB181AC9BA for ; Tue, 8 Oct 2019 01:15:40 +0000 (UTC) X-FDA: 76018850040.14.star17_316b19114f248 X-HE-Tag: star17_316b19114f248 X-Filterd-Recvd-Size: 4571 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Oct 2019 01:15:39 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id x127so9761668pfb.7 for ; Mon, 07 Oct 2019 18:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garybgenett-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9cyQFhSAKQfTng7yEumdtMl8I0uAIhCzRv5262lqo50=; b=Ci5s5I6fyC5OBV0jIt0KvLUXDp6P+eTOYegKTquH1jyxF3qMpkOB4anrbSA3j6qkdR 7CfubO8rep9msZh9l/DwcO8LSRGh5MUpeos3k14h8g5/1rcaWVv70m6/xJuOd2e8E1MJ v3HzkqsV6PmcS1UbHBn+zYoYPZBp+g/fRSN/NgmDTFqoXZjdv2x3BcGI24JoA1Zzjbwu BuwYqyYUQg2xV26CKy4KJ/566nXRuWnB72QUmzJfbwJ2Y2uw1iuC8SoS8Bltuk7X4JVE 9CnMtHML3ST58oY6HV9u01QCRgcEBwENP1pELB8gAExrwr8tAcxlBxWCQQ+hLwdzik9/ Atzg== 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=9cyQFhSAKQfTng7yEumdtMl8I0uAIhCzRv5262lqo50=; b=H/0ydk2aLLQiLEIEebkTcJSu7jvJnhW12qxsz9L4NpHBRCZo5WKGyU2vnLwBpa3UWJ k5JZH5PXxeWhd2LuIb9WznavWvwIYho3EostiIPfai0fWgfdDE3ywANid+fFGy9Oxl2D aMQmwVmYICmUc+hkqghJkgnNi/v6wbQ2icDIj21cVz3tNg+MEO8rGIKc4j3MHkR2vCKn ytRtVzq/gOSSVFpA+iQaGlAXaHWNVPjXf+2aHYcZLhELKDO7nk1lkKGvoYZNJQed7kvY 5c1I/slEsq1yTWNtXohwpu1vYx6QA3Upvol0+81FHbXR5s3qZN6k6A6OQpnNyIsyWNRw pf4A== X-Gm-Message-State: APjAAAVD5k6JtbbmYJSkE5ABfO9Bb0SqeCz7jjEEThjPiFuBSKOFfbgj 9rvqt+oW9/PfBqCrb14v6Z6jfQ== X-Google-Smtp-Source: APXvYqyQBfZYZ+yYwnaNorjcirZS4rk+r8N+Bqs1A4zpXzhQLjqmP55Y+9ErnyhvWmT6No19VIC7vA== X-Received: by 2002:aa7:94af:: with SMTP id a15mr20465958pfl.157.1570497337281; Mon, 07 Oct 2019 18:15:37 -0700 (PDT) Received: from spider ([71.212.141.220]) by smtp.gmail.com with ESMTPSA id f65sm15074172pgc.90.2019.10.07.18.15.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2019 18:15:36 -0700 (PDT) Date: Mon, 7 Oct 2019 18:15:33 -0700 From: -Gary- To: Qian Cai Cc: Hugh Dickins , linux-mm@kvack.org Subject: Re: [PATCH] shmem: add shmem_size option, set filesystem size Message-ID: <20191008011532.GB22291@spider> References: <20191007223235.GA22291@spider> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.107343, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > > A specific case where this is necessary would be if the initramfs were > > larger than half of the memory, such as a 2.5GB filesystem with 4GB of > > memory. Without this option, this causes a kernel panic. With this > > option, the user may specify something like 75%, which would allow the > > filesystem into memory, while still leaving enough resources to run > > a functioning system. > > Why would anyone need such a large an initramfs? Thank you for such a quick response, Qian! I really appreciate your question and consideration of my submission. The use case here is a live distribution, where the initramfs is a standard filesystem. It is common for these types of distributions to unpack root into memory. Most of them use SquashFS, and resize shmem using a smaller initramfs first. https://grml.org In my case, I am unpacking straight from the initramfs to alleviate the need for a separate file and packaging everything in an ISO. It very well could be that I am the only person who has ever needed this, but it has been a requirement for my distribution. https://sourceforge.net/projects/gary-os https://github.com/garybgenett/gary-os It is also possible that other live distributions are taking the approach they are because of the current inability to load an initrd/initramfs directly into memory without manually resizing the shmem filesystem first. Since I was in there hacking the feature, anyway, I thought it would be worth submitting. At the least, it should be a "#define", or something. Right now it is a hard-coded magic token. Thoughts? -- Gary