From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lithops.sigma-star.at ([195.201.40.130]:40286 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeLMWIL (ORCPT ); Thu, 13 Dec 2018 17:08:11 -0500 From: Richard Weinberger To: "Kirill A. Shutemov" Cc: zhangjun , Artem Bityutskiy , Adrian Hunter , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com, hch@lst.de, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] ubifs: fix page_count in ->ubifs_migrate_page() Date: Thu, 13 Dec 2018 23:08:08 +0100 Message-ID: <1683588.PnVoaTFAp1@blindfold> In-Reply-To: <20181213220000.7b56wysed67y5iv6@kshutemo-mobl1> References: <1544728817-2870-1-git-send-email-openzhangj@gmail.com> <8239265.3QN2sXB6kY@blindfold> <20181213220000.7b56wysed67y5iv6@kshutemo-mobl1> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Am Donnerstag, 13. Dezember 2018, 23:00:00 CET schrieb Kirill A. Shutemov: > > Let's wait a few days to give Kirill a chance to review, then I'll apply the patch. > > I don't remmeber much context now... > > Could you remind me why ubifs doesn't take additional pin when sets > PG_private? Because it does not use set_page_private(), it just sets the flag for internal accounting purposes. >>From UBIFS docs: * UBIFS uses 2 page flags: @PG_private and @PG_checked. @PG_private is set if * the page is dirty and is used for optimization purposes - dirty pages are * not budgeted so the flag shows that 'ubifs_write_end()' should not release * the budget for this page. The @PG_checked flag is set if full budgeting is * required for the page e.g., when it corresponds to a file hole or it is * beyond the file size. The budgeting is done in 'ubifs_write_begin()', because * it is OK to fail in this function, and the budget is released in * 'ubifs_write_end()'. So the @PG_private and @PG_checked flags carry * information about how the page was budgeted, to make it possible to release * the budget properly. > Migration is not the only place where the additional pin is implied. > See all users of page_has_private() helper. Notably reclaim path. Hmmm, I need to dig into that. I this is a problem then f2fs suffers from it too. At least from what I can tell from reading f2fs_migrate_page(). Thanks, //richard