Message ID | 20240219062730.3031391-8-hch@lst.de (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 05BD7C48260 for <linux-mm@archiver.kernel.org>; Mon, 19 Feb 2024 06:27:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A3B48D000C; Mon, 19 Feb 2024 01:27:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 753A48D0008; Mon, 19 Feb 2024 01:27:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57F368D000C; Mon, 19 Feb 2024 01:27:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 32E748D0008 for <linux-mm@kvack.org>; Mon, 19 Feb 2024 01:27:47 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0F6951601F3 for <linux-mm@kvack.org>; Mon, 19 Feb 2024 06:27:47 +0000 (UTC) X-FDA: 81807572574.24.A5E55FB Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf26.hostedemail.com (Postfix) with ESMTP id 92BC314000E for <linux-mm@kvack.org>; Mon, 19 Feb 2024 06:27:45 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="RoEVH2/H"; dmarc=none; spf=none (imf26.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708324065; h=from:from: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=tv4iW6mVqD6GYccLIm15nNo+UB3SFoik06dWZEM41Vo=; b=TOOHJw1CozttkRXHSGqt0c3F0gCcbYly95ort5GQZ8sCCaf1wyUsvphAn/fuwBiHx3RXO4 XQ9LU+8FSGzDB50W1nvl3Ntw0uUS8vPMXFsBBYPiHvlw9oOFSQIVlVg1K3zwyPWn5C2h38 Wi0wjvBXMtIiIbHSBvZbIz9kobpgz7E= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="RoEVH2/H"; dmarc=none; spf=none (imf26.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708324065; a=rsa-sha256; cv=none; b=EKGQASzTrwdtCn1nkLdhY+SHV1m9OF8vfF0Ge9harvJ3T/oNV2Tc0itF5v+nemutkJ4J1P i5wu3LaGIXLIpz/QGIZJzU4iDcU24oQBTA+flQQUqFjYcQFAea58gS77yrS5PXENPkCBX7 zYLQOSoB+bbaO6esYBsE1xz8yk8/G2Q= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=tv4iW6mVqD6GYccLIm15nNo+UB3SFoik06dWZEM41Vo=; b=RoEVH2/HhV1lqYtnFtwme3tKDG +x/uoXjToMK4Ur/e9iFCojRvxK8jioQY+Vqlo5P9rjfUE85L3kLULYYSG11Qi0fI/Ld+VlguPVOqy AziW06IRsuCLmzHZVh0Tl5VBzbMqyGRpAHYMTISXI+9Lnu1kERqCJyegVbleHI3sWGJySEFCI0sX7 +zioSoojHuUAHLHXuthz4BGqIV9V0ZrVAVJn2lbSltqeVh38xLTqujY7/mD2IriDsMJOnvNZYm/6/ C8vJ+UfVL3gmDbBkpsN5/WRCx1xD/+VLFzg4gaMJwNUdvcu5LaublV7E4dzDnGBoiThMi6KU9Dk7D BBsXE+7g==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbx7u-00000009F9h-0dAC; Mon, 19 Feb 2024 06:27:42 +0000 From: Christoph Hellwig <hch@lst.de> To: Chandan Babu R <chandan.babu@oracle.com>, "Darrick J. Wong" <djwong@kernel.org>, Hugh Dickins <hughd@google.com>, Andrew Morton <akpm@linux-foundation.org> Cc: Hui Su <sh_def@163.com>, linux-xfs@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox <willy@infradead.org> Subject: [PATCH 07/22] shmem: document how to "persist" data when using shmem_*file_setup Date: Mon, 19 Feb 2024 07:27:15 +0100 Message-Id: <20240219062730.3031391-8-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219062730.3031391-1-hch@lst.de> References: <20240219062730.3031391-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 92BC314000E X-Stat-Signature: ns4fedqp751icsoexxc8oujpdsrjsz1a X-Rspam-User: X-HE-Tag: 1708324065-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f0zevS5m3u6Rp2zUkKZWur0yBZEtw7vtgzJd67QmzGBgsioTJ257ndjTpHr2Gog+ZMn8ej2PzOggaybESxePDbD/+xb7COJGeENcw9xXVk8Pb5y7P3NpN6IFCIMNMkRUC35847FjGRKKfqdPA== 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
[01/22] mm: move mapping_set_update out of <linux/swap.h>
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index 95e70e9ea060f3..fb76da93d369cf 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2147,6 +2147,10 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, * Looks up the page cache entry at @inode & @index. If a folio is * present, it is returned locked with an increased refcount. * + * If the caller modifies data in the folio, it must call folio_mark_dirty() + * before unlocking the folio to ensure that the folio is not reclaimed. + * There is no need to reserve space before calling folio_mark_dirty(). + * * When no folio is found, the behavior depends on @sgp: * - for SGP_READ, *foliop is %NULL and 0 is returned * - for SGP_NOALLOC, *foliop is %NULL and -ENOENT is returned