Message ID | 20230421214400.2836131-8-mcgrof@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D210C7EE21 for <linux-mm@archiver.kernel.org>; Fri, 21 Apr 2023 21:44:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA4C66B0075; Fri, 21 Apr 2023 17:44:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9343F6B0078; Fri, 21 Apr 2023 17:44:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64E556B007D; Fri, 21 Apr 2023 17:44:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2FFA86B0074 for <linux-mm@kvack.org>; Fri, 21 Apr 2023 17:44:20 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0B72D16069B for <linux-mm@kvack.org>; Fri, 21 Apr 2023 21:44:20 +0000 (UTC) X-FDA: 80706727080.23.C0D5D56 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP id D598EA000B for <linux-mm@kvack.org>; Fri, 21 Apr 2023 21:44:17 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Gv4xXUfw; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf15.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682113458; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LRGm8v+C2VnFh3pJYXzbKwj2NvliqmXVbLHOoz9D9rs=; b=1e1/TXegRQVagR3Lls3TFwrL9a1yPCXnYwNVUPIxsQmnLcefQmygB39IOjUAcKS0DnDkf5 gCjfTneWgqaxTZGbxd0up6kFwgoaIEVU10xSEp28dBPRT/xLZ51nnTBvCUIj8H09jStKHl qulLHQv3EA2W4lY/d7gLCWPXj7pNUqs= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Gv4xXUfw; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf15.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682113458; a=rsa-sha256; cv=none; b=jr7Mpkk35krWxApKaUx7dWzwCgAZEgZTZ+JNTZVzsQBMevYCtqNOlhNz+PFk8OsFmcbCnU DQmTNEtyFnJWzJ1hTn1RuZnqSa1HseKXVfZ7nwTlKIzBhpiN3ilS+VCf5N9PicIVQhQRAq CeTNTHnLdts9nDiBFe3+wKBxrxQUJuw= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=LRGm8v+C2VnFh3pJYXzbKwj2NvliqmXVbLHOoz9D9rs=; b=Gv4xXUfwg6Tqrov7HtOq12Iot5 YO5wR1wBRRe+FoidC8runo8IO16BDwaMfjnowR194HePAotck078Dc52Y5LhgHsJWaSdFz/ExDOoW 7UvJg+gaENVFRZFuUklS2jbQPIu6sP031vvUKDVO8op0VWHJ/pcNAbKtxQ6EJtE3JOGWA8i9aCI4G c82Y5dwvzAyUa4CC4Jt/QPxPn6XSF0jejQ+JpFEAjr1mjFYM6xQTv/oz9ZsmadJRNPxXXDoGL2kGk x5ARZON7gmkNiGzDhbMd8jQFJ5x3RYgTnUCgMJhDF50jxO3kH/6kEmfu6+iJAJL3r0nsysDSme+ZO aDY1SY0g==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1ppyY1-00Btou-2Z; Fri, 21 Apr 2023 21:44:05 +0000 From: Luis Chamberlain <mcgrof@kernel.org> To: hughd@google.com, akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org, djwong@kernel.org Cc: p.raghav@samsung.com, da.gomez@samsung.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, hare@suse.de, kbusch@kernel.org, mcgrof@kernel.org, patches@lists.linux.dev, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC 7/8] shmem: add high order page support Date: Fri, 21 Apr 2023 14:43:59 -0700 Message-Id: <20230421214400.2836131-8-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230421214400.2836131-1-mcgrof@kernel.org> References: <20230421214400.2836131-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D598EA000B X-Stat-Signature: czk46iq68rp1w9u77d4qu4ryror4js5b X-HE-Tag: 1682113457-241303 X-HE-Meta: U2FsdGVkX1/fe6vvRXN8Nvj7VZMfrqWSS67Jd9Ktuy4KN8E9VCQnoQXHhf8h2Rl+0dY2ixJH2UrCPnXsZZ1l5Ml+kVB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2viXT/II6Xhl6GH6HLKefSJab0zzdYsqC40AjoSSxMGHT/XoqYgM30M/Kfh78EgnOprLRlgXUyjp0/kX8k6CTW2LS9/km2KvDJExuNJQYUTR2d4zFp2qFFYd6N1lEFIiQG2+6GeA9P0530iclc1wyFDycAa6cto6pppfR0+WqpcLljaSGVBiIgOyJG/sH5FpKIfPD1M2C22BYAcsVU3QPUw8sZ672pObC8fl1I= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
shmem: add support for blocksize > PAGE_SIZE
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index 5a64efd1f3c2..740b4448f936 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1621,9 +1621,15 @@ static struct folio *shmem_alloc_folio(gfp_t gfp, { struct vm_area_struct pvma; struct folio *folio; + struct inode *inode = &info->vfs_inode; + struct super_block *i_sb = inode->i_sb; + int order = 0; + + if (!(i_sb->s_flags & SB_KERNMOUNT)) + order = i_sb->s_blocksize_bits - PAGE_SHIFT; shmem_pseudo_vma_init(&pvma, info, index); - folio = vma_alloc_folio(gfp, 0, &pvma, 0, false); + folio = vma_alloc_folio(gfp, order, &pvma, 0, false); shmem_pseudo_vma_destroy(&pvma); return folio;
To support high order block sizes we want to support a high order folios so to treat the larger block atomically. Add support for this for tmpfs mounts. Right now this produces no functional changes since we only allow one single block size, matching the PAGE_SIZE and so the order is always 0. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> --- mm/shmem.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)