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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB9C7C47DDF for ; Fri, 26 Jan 2024 15:49:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D1826B009B; Fri, 26 Jan 2024 10:49:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1802F6B009F; Fri, 26 Jan 2024 10:49:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0480A6B00A0; Fri, 26 Jan 2024 10:49:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E98126B009B for ; Fri, 26 Jan 2024 10:49:36 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BF29AA08B0 for ; Fri, 26 Jan 2024 15:49:36 +0000 (UTC) X-FDA: 81721897152.05.C4E0DA8 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id 281B9180011 for ; Fri, 26 Jan 2024 15:49:34 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZWap1XKi; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706284175; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RQIoaubNFOA6BD84xMXnA0OKagqm7V7VFuX1bSprj3U=; b=Ti5uGpWHfSWXdZKmQ4Wcbz7VFzWbYW4Mbk8fzmt9T+Zb2kJzgffrRtpi806yHDXu9kt1yH iHJOIFVzUaMQX/pCcTp7cLJRtF3B44o26FA1wJVLSwsGL414YpOGRttqX7sOrGTpjH/XJC wbOXLe5neNjsvnyIFZJEjbNkqQRn2HE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706284175; a=rsa-sha256; cv=none; b=UutcuTKQlBk4cr5jBVE4RWnS9vjPJuvBeKokOfNW4gONrCQ4CL4unsJn1jVBeso8FGbz8i 9JBCXTdFElDgMnoInclf4B6wILBl5fEhwSHNb9e+XhCf80/PWIMnT+Hg3sU139gg91dth7 dDvTeCw8Rj6C92l4pl6mP8Zzt7U2AVM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ZWap1XKi; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RQIoaubNFOA6BD84xMXnA0OKagqm7V7VFuX1bSprj3U=; b=ZWap1XKiu7Ns68COObnmUKY5z0 CqTRB+PQCc47ydXa3zHY84TGHGp7R/oHbXjz9JtlRX6FrHBwFhBmgXWx9lMFRTcjydmRAcauTSHTJ FSyzrhYQcG/u/Vv0fBkZLEuscizqLbUvhXltgYc4iVnph805fb8p8XAg/Fjb7Su60tOKy9kF8L2Mb nApnvSFN2GysSm9AY+Dgpg3vI6zQFjWO3x7B+3v3QcB2VsZ+6cojTX3nVcDHMPDrKmYL8nqcTi4x1 JoehJwccjeL/UEhQrfcBUxvV1Wg64G8CIBBFQi0TK/YzJ5z9Zlw3SMtJ3iSq0B48l6Hgkwxvc3fBH d0nEsbGw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTOSQ-0000000E4uC-3btt; Fri, 26 Jan 2024 15:49:30 +0000 Date: Fri, 26 Jan 2024 15:49:30 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 07/21] shmem: document how to "persist" data when using shmem_*file_setup Message-ID: References: <20240126132903.2700077-1-hch@lst.de> <20240126132903.2700077-8-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240126132903.2700077-8-hch@lst.de> X-Rspamd-Queue-Id: 281B9180011 X-Rspam-User: X-Stat-Signature: m9468sktna8f9gchdyg767qwx1a3rq51 X-Rspamd-Server: rspam03 X-HE-Tag: 1706284174-619398 X-HE-Meta: U2FsdGVkX1+PvTH2ruAFkRnVETqSGoLLP/QcSOZwaq6CvCl/yj3PHQ704VjEKPIWi5YNQxq4mL6mK1Cc9rRke00etwu7YgibayB9icGHbhugahup1wA39vCjeRcHRXa8bk6SrR75D1upZ3PS1upd5I+cC4GKZ/IZHB+Cvm1wzbpysTFu2wZvcdG3dRXi9pySKBsaKdt6hTm41tCCe/kBllPZ0itAulRnQcvshZYH94xIu3scW5ydr6aTJA33lIu1TLWucc/liOYhcLCpCQtRV39YHqpVufZqdAc9cCW14VU5w5nKWc251xglKw+A+lpdOSmyzrM2GZCMSLjWggvfAxvU2I3CkYohNYoDde2dfIHDr3DC9wNkFEwBPz+PbFFRD28ErnVUxcEUGPVZ5EUHMJfW4Ll9lnax+PI0thjR6vhL0LtoBFmaK6MVbgnJztXNIAqBiSFnOvy4hxAnISXrBTBzJZQGNlI8YxTq/lSeoylDHQXbAa3rVXuyLWYW98mIbRGVIat+ICOww7eI4v9dG5NvSLip6ORxRLadHQDaW2UajrN7Rqsg+oNJcthG6GP2rWAKuoX6XZ5B8rPdaBGhzpQIf4/nLiiqb1fSAl/FXVb9PTL5QvbrBhMvzSJUpi55lFXDssCw+hBTa+lB1IRzMyDlk9zZYpi9qA3mytlIiEcae7gikvDiRQdW1C5XR9bnmtImxfKICjys61zz1j/Ed59pbkw4xAxBy0JByAnFrL0kd1I+4TMwXT8Nwdhvn2ELQuBky87t8dhvv2XH/+bGV7MJ2LCy2HsnuX4lMJaRTuMlzIKVAYdf0hNW7477AbLO5M2bxtbBZEwEKqeFGQFhsnqPf05FayP6CWBCXFRzQL4ycS/Qsqlcs44zoMbh7hSH8HKNZOHQ0NI9QXh0ZNbeWD6uxDGih3heas/K0884UcS0RcB4os3K1f/M54n8Psq/lfXJrUZYm0oort3qK5u R1zXH9X4 v1RHGyH1RbGY8gLPJvkRyQt15EcmHqDpbVGFrUFWlQa8Bx/TVO4WDK8+2A1dz8vctz8wkKol+D82iFS1Zqe8wSV1ZA7YD9i+o0Zm9QWcqOP7HKks886QHCxoMCrGSsdsksb1JP9JXutTvz+Nz+sX9Rjj6Fsy95FejyQJrao72yyUqznFfjMEv+fAURQ== 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: List-Subscribe: List-Unsubscribe: On Fri, Jan 26, 2024 at 02:28:49PM +0100, Christoph Hellwig wrote: > +++ b/mm/shmem.c > @@ -2150,6 +2150,11 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, > * > * Return: The found folio, %NULL if SGP_READ or SGP_NOALLOC was passed in @sgp > * and no folio was found at @index, or an ERR_PTR() otherwise. > + * > + * If the caller modifies data in the returned folio, it must call > + * folio_mark_dirty() on the locked folio before dropping the reference to > + * ensure the folio is not reclaimed. Unlike for normal file systems there is > + * no need to reserve space for users of shmem_*file_setup(). This doesn't quite make sense to me. Do you mean: * 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 equivalent to write_begin/write_end for shmem. (also this should go before the Return: section; the return section should be the last thing in the kernel-doc)