Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8580220rwi; Tue, 25 Oct 2022 08:20:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EjRFKO8grDGiI73NTOY4a4LIEvQbdy+VHxsG6dHQKsp/2xSXx7YS76twxbrP0lbMfcaOk X-Received: by 2002:a17:907:9627:b0:78d:a7d8:9407 with SMTP id gb39-20020a170907962700b0078da7d89407mr32851544ejc.675.1666711241930; Tue, 25 Oct 2022 08:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666711241; cv=none; d=google.com; s=arc-20160816; b=MEZYYkw3k5p6X8OXNjPPnEmrQ1VceFmp+YIogw/JSCGaBha3oZw/Uqxg49/4p1BqR5 xJrp5076yup1fA5i3jnPQuRDo+F3P+pYx98UTIjxHsRu23xuZzRNxSIE3uWE047j6f7P WpZbl+o5A3Fl8iwjwR39PIK3A4P8jJJGTCecKG4L2VpZ8/5RaCaDf6MokCXF52QOi6mZ MPzkBj74AZuDxaI2qZXjfj3Co+8bYsYf7X1Fd+TQ7yYP0X34fYibzj2/4XPITPLtFb38 I94ID/l4c2e9yWcgLPJ+k78sXS52rUL8b7Q0PkE7BF78Z0G8iOCo19mORsINPlvL4B5N OJlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=M79Zo45I4bE9WQNkOFTdWrsHTrfrgiJTHtIWiYegoZg=; b=EG0dMm3RxECy0btjlbM6h7KiZZHJU9aH18aRLBDEOd7gMGk01CwqPZCpoBY2uwodWe YWHdQWJqzjGWO/HlpwajeGWJsSUrizf2FEgRY6eQlX93sj/3zygQMcCXmSm90dnZb0// 4u0dgbgpebGWSywOFHhjVUvUZJDDBNS4p2I5r+x0L0p3FwzEXnGlWQ7Ltv4tpP1GEhDI o0xFFfZcP845YzfINDNZD2Z1PG7pVuGRUHN26LHZbDVl+AyIXd3oFlmNZ3KariUD+MOc Wn4kPmNZ4/K30/bRNokSD42O1eX4LO29/7ypeC7B/fRp6OHE1WchU4KDiW+XyvTiGmm/ SEjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="FX9N/s9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a056402520a00b0046054d6b3a8si3558138edd.302.2022.10.25.08.20.15; Tue, 25 Oct 2022 08:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="FX9N/s9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232978AbiJYPME (ORCPT + 99 others); Tue, 25 Oct 2022 11:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232936AbiJYPL7 (ORCPT ); Tue, 25 Oct 2022 11:11:59 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E702663 for ; Tue, 25 Oct 2022 08:11:57 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id a5so8249230qkl.6 for ; Tue, 25 Oct 2022 08:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=M79Zo45I4bE9WQNkOFTdWrsHTrfrgiJTHtIWiYegoZg=; b=FX9N/s9/SutgcW/9gcbePP3lroDMrQICKB6xcxQVBj4qtH8fmRaBUvZHexK1tfGk1v uKyM+qQHZbOOY1CWZPaShmnA2n/NLOn7R+ImH/Mmv8B2BwoohpGZ3Z1TTVD52vYZsrgD G/OgMCKF1T6Zq1ULEGFTjvYWuPWBuO5TabbyDsPyC82NHSV4b/MWyKxUeFU6mIgr5TWA Siju8v07GQvikO4Q81JV2VfCoAX6lJIoHPFdvTBWGxHnBbHT8MAuA8GBNsbHWZhHHpAp 32eGFEih6wnI57wCKepW1niVlOP6YSn1l3lloG8co96YKbVIG12l4rONXoH4iDctBmzk Wq2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M79Zo45I4bE9WQNkOFTdWrsHTrfrgiJTHtIWiYegoZg=; b=Bmx+bJQx2ODTa4MxlBnLC6fW7Ux3UrkMM3fc94Ea75s+58arI3yn9Sa+rtHueXa4PH S4WZAnbpWO/mc1t2TTEjYbsMFPMNbol1i0FBhHPMfLw+317bINj/rhGjU1iOZrrEeioY lNekiVuI1SSF/9xb5ZG5NQQjSO5N/QsiG4i3lkCk/mtd40XaWz3J9fuwyI4cZB1DtfWm 4hXUj3A4MmcjjGgpKLMxGqBIhJ3iCtZlhl6pPXSa71MFsJip6xp3I8XPW5M77gd6NfLa JEobpXX/UlbY9E/qGvAHTx6hGHpdyNL6W7Re9FzaZmYmU9regv1ryYL54pvxZrBwfgG8 SAJw== X-Gm-Message-State: ACrzQf2ezhq+L0Uf0iaVSnM4gHBEYA3q8nU2sDnccttsmL2qMzg2WP7p W6Ht1/pCRIlJkX2+97QrrW4hlw== X-Received: by 2002:a37:c203:0:b0:6ee:a214:a560 with SMTP id i3-20020a37c203000000b006eea214a560mr20946826qkm.528.1666710716191; Tue, 25 Oct 2022 08:11:56 -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 fp9-20020a05622a508900b0039a08c0a594sm1694087qtb.82.2022.10.25.08.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 08:11:55 -0700 (PDT) Date: Tue, 25 Oct 2022 08:11:44 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Greg Kroah-Hartman cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Mel Gorman , "Matthew Wilcox (Oracle)" , Yang Shi , Brian Foster , Dan Streetman , Miaohe Lin , Oleksandr Natalenko , Seth Jennings , Vitaly Wool , Andrew Morton , Tvrtko Ursulin Subject: Re: [PATCH 6.0 19/20] mm/huge_memory: do not clobber swp_entry_t during THP split In-Reply-To: <20221024112935.173960536@linuxfoundation.org> Message-ID: References: <20221024112934.415391158@linuxfoundation.org> <20221024112935.173960536@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Oct 2022, Greg Kroah-Hartman wrote: > From: Mel Gorman > > commit 71e2d666ef85d51834d658830f823560c402b8b6 upstream. > > The following has been observed when running stressng mmap since commit > b653db77350c ("mm: Clear page->private when splitting or migrating a page") > > watchdog: BUG: soft lockup - CPU#75 stuck for 26s! [stress-ng:9546] > CPU: 75 PID: 9546 Comm: stress-ng Tainted: G E 6.0.0-revert-b653db77-fix+ #29 0357d79b60fb09775f678e4f3f64ef0579ad1374 > Hardware name: SGI.COM C2112-4GP3/X10DRT-P-Series, BIOS 2.0a 05/09/2016 > RIP: 0010:xas_descend+0x28/0x80 > Code: cc cc 0f b6 0e 48 8b 57 08 48 d3 ea 83 e2 3f 89 d0 48 83 c0 04 48 8b 44 c6 08 48 89 77 18 48 89 c1 83 e1 03 48 83 f9 02 75 08 <48> 3d fd 00 00 00 76 08 88 57 12 c3 cc cc cc cc 48 c1 e8 02 89 c2 > RSP: 0018:ffffbbf02a2236a8 EFLAGS: 00000246 > RAX: ffff9cab7d6a0002 RBX: ffffe04b0af88040 RCX: 0000000000000002 > RDX: 0000000000000030 RSI: ffff9cab60509b60 RDI: ffffbbf02a2236c0 > RBP: 0000000000000000 R08: ffff9cab60509b60 R09: ffffbbf02a2236c0 > R10: 0000000000000001 R11: ffffbbf02a223698 R12: 0000000000000000 > R13: ffff9cab4e28da80 R14: 0000000000039c01 R15: ffff9cab4e28da88 > FS: 00007fab89b85e40(0000) GS:ffff9cea3fcc0000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 00007fab84e00000 CR3: 00000040b73a4003 CR4: 00000000003706e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > Call Trace: > > xas_load+0x3a/0x50 > __filemap_get_folio+0x80/0x370 > ? put_swap_page+0x163/0x360 > pagecache_get_page+0x13/0x90 > __try_to_reclaim_swap+0x50/0x190 > scan_swap_map_slots+0x31e/0x670 > get_swap_pages+0x226/0x3c0 > folio_alloc_swap+0x1cc/0x240 > add_to_swap+0x14/0x70 > shrink_page_list+0x968/0xbc0 > reclaim_page_list+0x70/0xf0 > reclaim_pages+0xdd/0x120 > madvise_cold_or_pageout_pte_range+0x814/0xf30 > walk_pgd_range+0x637/0xa30 > __walk_page_range+0x142/0x170 > walk_page_range+0x146/0x170 > madvise_pageout+0xb7/0x280 > ? asm_common_interrupt+0x22/0x40 > madvise_vma_behavior+0x3b7/0xac0 > ? find_vma+0x4a/0x70 > ? find_vma+0x64/0x70 > ? madvise_vma_anon_name+0x40/0x40 > madvise_walk_vmas+0xa6/0x130 > do_madvise+0x2f4/0x360 > __x64_sys_madvise+0x26/0x30 > do_syscall_64+0x5b/0x80 > ? do_syscall_64+0x67/0x80 > ? syscall_exit_to_user_mode+0x17/0x40 > ? do_syscall_64+0x67/0x80 > ? syscall_exit_to_user_mode+0x17/0x40 > ? do_syscall_64+0x67/0x80 > ? do_syscall_64+0x67/0x80 > ? common_interrupt+0x8b/0xa0 > entry_SYSCALL_64_after_hwframe+0x63/0xcd > > The problem can be reproduced with the mmtests config > config-workload-stressng-mmap. It does not always happen and when it > triggers is variable but it has happened on multiple machines. > > The intent of commit b653db77350c patch was to avoid the case where > PG_private is clear but folio->private is not-NULL. However, THP tail > pages uses page->private for "swp_entry_t if folio_test_swapcache()" as > stated in the documentation for struct folio. This patch only clobbers > page->private for tail pages if the head page was not in swapcache and > warns once if page->private had an unexpected value. > > Link: https://lkml.kernel.org/r/20221019134156.zjyyn5aownakvztf@techsingularity.net > Fixes: b653db77350c ("mm: Clear page->private when splitting or migrating a page") > Signed-off-by: Mel Gorman > Cc: Matthew Wilcox (Oracle) > Cc: Mel Gorman > Cc: Yang Shi > Cc: Brian Foster > Cc: Dan Streetman > Cc: Miaohe Lin > Cc: Oleksandr Natalenko > Cc: Seth Jennings > Cc: Vitaly Wool > Cc: > Signed-off-by: Andrew Morton > Signed-off-by: Greg Kroah-Hartman Greg, this patch from Mel is important, but introduces a warning which is giving Tvrtko trouble - see linux-mm https://lore.kernel.org/linux-mm/1596edbb-02ad-6bdf-51b8-15c2d2e08b76@linux.intel.com/ We already have the fix for the warning, it's making its way through the system, and is marked for stable, but it has not reached Linus's tree yet. Please drop this 19/20 from 6.0.4, then I'll reply to this to let you know when the fix does reach Linus's tree - hopefully the two can go together in the next 6.0-stable. I apologize for not writing yesterday: gmail had gathered together different threads with the same subject, I thought you and stable were Cc'ed on the linux-mm mail and you would immediately drop it yourself, but in fact you were not on that thread at all. Thanks, Hugh