From patchwork Thu Jul 27 20:39:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13330724 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 DD528EB64DD for ; Thu, 27 Jul 2023 20:39:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF6BE6B0072; Thu, 27 Jul 2023 16:39:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA7436B0074; Thu, 27 Jul 2023 16:39:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B95A96B0075; Thu, 27 Jul 2023 16:39:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id AAABF6B0072 for ; Thu, 27 Jul 2023 16:39:49 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 69B5EA01D3 for ; Thu, 27 Jul 2023 20:39:49 +0000 (UTC) X-FDA: 81058558098.06.4FCA3EA Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 7D60220010 for ; Thu, 27 Jul 2023 20:39:47 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=e8VNTX9o; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690490387; 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: references:dkim-signature; bh=rFRboTKHF6R3bnlK4PcR6XSjRh3u8+Vh4CH4TGFGvXo=; b=Cdfrp6HEWoISxFmFPjdzNJtqRbZ4sN/PRzZfEnNCuiM+jAi/zWTWuXTBdqVsrbMgKJFhv1 vlvyE0mgLFmfbaUHQlRrEub5pSpGfMFl5+5PNOIR3GD5Eu0+grm1mINVcozqBV0zmZqefi Od4r+T03aNZrO3PlufkGe7cB/gmveI4= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=e8VNTX9o; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690490388; a=rsa-sha256; cv=none; b=kVcAHw1iom0uMG1NM1ZfUeWMBsI9Mm3HpX9VjhvboAye+iuNiYypObfVeADjstNYSpwvIH 8QErqsrb+IwbkLg9OewzhRW2MhRjfRcIeNjSMUhZNz3YyTwmsDSiggMKCmQOACjT3vCGC/ 2oYT5DWHU4/6HTDQVKF6W4eIN2QdqgY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=rFRboTKHF6R3bnlK4PcR6XSjRh3u8+Vh4CH4TGFGvXo=; b=e8VNTX9oIWxuUr3GAW6toOTYYo H8Eqdu1dDJAMf60LVxfO4ZIcuTeYSd7tAGuHvOMobnWWHyoXwXAQ4fZIOs6PX0Bp0Fq2r/qAeLwqA rk9uY6apj/l4ZEcQWMBM0crUdY7s/htZGIkWI2drb2rj4v3AmrTwD7/Q258LQwMqiuMKtbZRSR+0r CnqLNniiN1ru7sjopRlSMDkq13t/11mOmefzdqK6i4Dl5Jy742PaFQ5HCWJTPOkRK2p7iVlcrwibz z14R62UVEe1wlUIAv7Q4xN+wt+DCmsFxFvWzNdW7AQI2Vy4mu3Yi0/zEQMZ8QdVn3492vSyC1Al48 GqH6w7tg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qP7lw-007qzk-HO; Thu, 27 Jul 2023 20:39:44 +0000 Date: Thu, 27 Jul 2023 21:39:44 +0100 From: Matthew Wilcox To: Andrew Morton Cc: linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCH] mm: Improve the comment in isolate_migratepages_block() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 7D60220010 X-Stat-Signature: r9eeyfhuoexmhmp4xa6rpkzrp3a4tnf6 X-Rspam-User: X-HE-Tag: 1690490387-919208 X-HE-Meta: U2FsdGVkX1/aTAg0y8XLSBT/qx2Z3aMsYJaRBTWkbfGACZJ3IMEpRMkmYKmIklbZxi69pVfLJcQSIRhnpkiZsP6yNmZHj4+lWv0zttLjpBf7WgcxzG/7zT8xxkUufQYnHGOn1o2wxnSfT5xxqSDUsjjolOzsbKi/QlQ6YZLzzAgqcCh7naFXiC0nMcozPJPkN3in/4gFVzhcIziMllmIycmQ8tai1bP1i1hEnVwcAgJVPz+hXto7n3u1S09mYWhk7tFvPkOFUwILQgGC34SdomJQH1KisLbhwaKE5JuXvK/BKgbdFjptmvTN6i5hbS4rA+Xi27bCDk+AAqsjwejWF9CpK00u+NSQQvYgfTQAtpKvm+12pC5V1kamb01nwT2EkdLZca+Y8phuOqUXwtcLNNcoVAJ9awkxkwFPPC2j29/df+dByhwzElrfSSelYumobqbIJeHbEpPFXzy7kUnMDwIjuQDh9h9q388dYyAzzJg3Yp7GsPYjC7SUjBEWR3t5sFcLmiSa0jHt5tvkqQWd4g1FmicjHz0wVOpgvgwYb4eRVzDax7RuYoZDr3/DVKx8+yRtq6Y8t1+e/yxm5xlrSAvIMe4/J06hhgmim66Km74h7JjjMS7h5B586TD3NpKIvSGY/bsBTQX8SzziVCb7MEQVluwbdmNkQILd9YYg8/cgdwrj86FmgRlBhi/2fgMpU6bV+2nLyKNSOyNIUDoi+ljO0xhrGFoB7QGA7bG8D9JXDdwpliwj0EejUPKCmIo7d793Y2QLtSgBvHoZbKU9daZZ7qKDEQ5lUbP3jR8SCKgimzrFv8frAKT79sfSwMBi31bHc4AWezxEJzwbDf0VCeaFTJth6lO1nWJJ3SpwcMzFHUKVIie5ZUbTNfnW3mP07z6gK9204lqRCzrsI5yNhlMD3JLtydQymEy0iUZpEfW4lOVltiF81RnHrFjGHCg4DoImlPMtJPNlvB/ARbL HIOrPSKS daZ0XgJYywxkaLzfnQnWpE8B0GJIK5/n69dxcMmofhacOSOEMYbGoiLZsJxIr7XoyajYr+CLc5xASN7cG8dJdXCQursxg2Z+inJ8ypThWX7EcwCXw1qbj8wwNWXzhc92vF8TQE7nEcneYmHb1mJjlr2zpa/7vrVOAC8fSL+ltPWGlvKX+9QXscUCb9fxc7PSxKsFtdDTSU/OA51/cQvJuoHyAMZ7GkYNJXb/wsdqUPZxigIA/fW67iKbsMg== 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 recent patch shows that not everybody understands that "stabilise the mapping" really means "prevent the mapping from being freed", so change the wording to hopefully make that more clear. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand diff --git a/mm/compaction.c b/mm/compaction.c index 9641e2131901..9be2c3504ff2 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1095,13 +1095,13 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, bool migrate_dirty; /* - * Only pages without mappings or that have a - * ->migrate_folio callback are possible to migrate - * without blocking. However, we can be racing with - * truncation so it's necessary to lock the page - * to stabilise the mapping as truncation holds - * the page lock until after the page is removed - * from the page cache. + * Only folios without mappings or that have + * a ->migrate_folio callback are possible to + * migrate without blocking. However, we may + * be racing with truncation, which can free + * the mapping. Truncation holds the folio lock + * until after the folio is removed from the page + * cache so holding it ourselves is sufficient. */ if (!folio_trylock(folio)) goto isolate_fail_put;