From patchwork Tue Aug 17 08:03:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12440769 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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 96D91C4338F for ; Tue, 17 Aug 2021 08:04:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2EE6860F41 for ; Tue, 17 Aug 2021 08:04:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2EE6860F41 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 81E036B006C; Tue, 17 Aug 2021 04:04:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CE4A6B0072; Tue, 17 Aug 2021 04:04:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BCD38D0001; Tue, 17 Aug 2021 04:04:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 515B76B006C for ; Tue, 17 Aug 2021 04:04:09 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 05564204C1 for ; Tue, 17 Aug 2021 08:04:09 +0000 (UTC) X-FDA: 78483834618.10.6AB840C Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by imf20.hostedemail.com (Postfix) with ESMTP id 3D65BD00A3EC for ; Tue, 17 Aug 2021 08:04:07 +0000 (UTC) Received: by mail-qk1-f182.google.com with SMTP id t3so22071428qkg.11 for ; Tue, 17 Aug 2021 01:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version; bh=I3eCW0EJLWa0OXWClQfPVWKDZ0F0mvi6iBQTgK33L6k=; b=fAq+nzkSfaFBcy+WbLhLfyqEa3yM7MJcF9DRCaZxwaBikIW8Bdca7VuEm0+bEyMIHB xpVxEbKi6drCLlUUW2y6lFbcF7EediSc2LG9UbWp5yH6/YhFL0H/TdINaJpaKvF7vs5R Vff1sTmLCF1V/pBMwjddFsWGRjLf1Mzcd6ni8J6DZvJkd2jHFQVRdAOOgybm2THIsRRV PEyWoEvSCifPjrXEoeUlaxo3Tt6Agt/szS6wLQwrt3hvjzS4H11unWhZy1EkCK9icWfQ h8AQck8Rl/GVbdKHbiLtl98lUumW7DN1TW1YjE+4y+LelRaFLXVgqJAdssxCbp3e/IaN fUtA== 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:mime-version; bh=I3eCW0EJLWa0OXWClQfPVWKDZ0F0mvi6iBQTgK33L6k=; b=pOMI4/7wFWtymuEG2HYuC3G/q/k5kTRi3J4/H5n/iLjNv5OvA3DVLRJzUzm8VpSPe4 frs36gNtIFeKopyW76riEN6tJfgCit8OWBwWBTYzRiWdPjTVxQXN5wKiOODzEHXtGDAM bXfR1vZEOd/iSP2jd1DG5H6vzPZb6VzEA5N0aCqUme+BLdH3BHO0AFVIeJThvAiPPKwB EXOEqji3mM1NTMdtqoZbJRIH4G7tai1YCH/QTdfkX0z3y/dEWsGaQVqkNw6HAFy7ojqJ 2K+saxOMqLaMVviX5vDq8ruLzo1GAQU4FQlVZ/C9noWpZv7c3t4ivXWFTQo4aPJZfaBv onjQ== X-Gm-Message-State: AOAM530KyLAClA/koYgOwkE1EsbYP++S0xjvYOOE3rx9fYe1zbpLGsD2 M6n+pus7pihItp75qIRoYQLDtg== X-Google-Smtp-Source: ABdhPJw1m4ZxT2fB5sZSrVPdosAw5xyRDr0oCGLo586cy0sck6TqTzHsMql/nIjPVmBfYFsyfMpimg== X-Received: by 2002:a05:620a:2297:: with SMTP id o23mr809471qkh.405.1629187446363; Tue, 17 Aug 2021 01:04:06 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id h2sm891887qko.127.2021.08.17.01.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 01:04:05 -0700 (PDT) Date: Tue, 17 Aug 2021 01:03:53 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Hugh Dickins , Shakeel Butt , "Kirill A. Shutemov" , Yang Shi , Miaohe Lin , Mike Kravetz , Michal Hocko , Rik van Riel , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/9] huge tmpfs: shmem_is_huge() fixes and cleanups Message-ID: MIME-Version: 1.0 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=fAq+nzkS; spf=pass (imf20.hostedemail.com: domain of hughd@google.com designates 209.85.222.182 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3D65BD00A3EC X-Stat-Signature: q6fawf7dwhcxf6n8whu59z5ss5g66ine X-HE-Tag: 1629187447-820999 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: A series of huge tmpfs fixes and cleanups, suitable for 5.15, taken from the earlier 16 "tmpfs: HUGEPAGE and MEM_LOCK fcntls and flags": https://lore.kernel.org/linux-mm/2862852d-badd-7486-3a8e-c5ea9666d6fb@google.com/ The API additions in that series have not yet been fully agreed, let's revisit those after the 5.15 merge window, but please proceed now with the uncontroversial preliminaries - thanks. Still diffed against 5.14-rc3: no conflict yet with 5.14-rc6 or linux-next or mmotm - no problems with the foliage. Most exactly as in the 16, with a few commit comments clarified from review; most already Reviewed-by Yang Shi (many thanks!), tags added. Exceptions: 6/9 SGP_NOALLOC introduced to resolve our review doubts, that and 7/9 not yet tagged, 9/9 now added from a posting last year: Kirill's "What breaks?" if shmem_enabled "always" reminds me that I'm still carrying the i915 THP fix, as corrected by Matthew. 1/9 huge tmpfs: fix fallocate(vanilla) advance over huge pages 2/9 huge tmpfs: fix split_huge_page() after FALLOC_FL_KEEP_SIZE 3/9 huge tmpfs: remove shrinklist addition from shmem_setattr() 4/9 huge tmpfs: revert shmem's use of transhuge_vma_enabled() 5/9 huge tmpfs: move shmem_huge_enabled() upwards 6/9 huge tmpfs: SGP_NOALLOC to stop collapse_file() on race 7/9 huge tmpfs: shmem_is_huge(vma, inode, index) 8/9 huge tmpfs: decide stat.st_blksize by shmem_is_huge() 9/9 shmem: shmem_writepage() split unlikely i915 THP include/linux/shmem_fs.h | 23 +++- mm/huge_memory.c | 6 - mm/khugepaged.c | 2 mm/shmem.c | 229 ++++++++++++++++++----------------------- 4 files changed, 129 insertions(+), 131 deletions(-) Hugh