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 X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B7FC2D0E3 for ; Mon, 14 Sep 2020 16:47:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3396A217BA for ; Mon, 14 Sep 2020 16:47:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DEb/3SuQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3396A217BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 64B0B6B0070; Mon, 14 Sep 2020 12:47:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5FA536B0074; Mon, 14 Sep 2020 12:47:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 510AD6B0075; Mon, 14 Sep 2020 12:47:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 3B0556B0070 for ; Mon, 14 Sep 2020 12:47:36 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EB68E181AEF15 for ; Mon, 14 Sep 2020 16:47:35 +0000 (UTC) X-FDA: 77262248070.14.sack38_3c089552710a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id C20CE18229818 for ; Mon, 14 Sep 2020 16:47:35 +0000 (UTC) X-HE-Tag: sack38_3c089552710a X-Filterd-Recvd-Size: 6229 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Mon, 14 Sep 2020 16:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600102054; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=83hSG57S8ARdg4I7deJU3gjqEand93evAvlu89oYvEQ=; b=DEb/3SuQe3WeTL+AOMnBDIyLiss1ylgHQ8oUMpKgaW/KPwejtXH07XgLH1gnrpf98Ew9vI sCYRj6bRqmZGqorovwLPXKAKBWVq5AGbAvKTGgjRvZfwXzULOVI8otH+l8FAfwM8he9O6H 8oPHNKEzZqWiGTbIWct2CZlzG1FaxuI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-333-ADpwFPEOOFG6k2QZRmEMDw-1; Mon, 14 Sep 2020 12:47:30 -0400 X-MC-Unique: ADpwFPEOOFG6k2QZRmEMDw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6CE8010BBEC2; Mon, 14 Sep 2020 16:47:28 +0000 (UTC) Received: from ovpn-113-249.rdu2.redhat.com (ovpn-113-249.rdu2.redhat.com [10.10.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF6DD19C4F; Mon, 14 Sep 2020 16:47:26 +0000 (UTC) Message-ID: <54766b04a5bc21b8573666b0c4b50b3e982ed5e5.camel@redhat.com> Subject: Re: [PATCH v2 3/8] mm: Optimise madvise WILLNEED From: Qian Cai To: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Cc: intel-gfx@lists.freedesktop.org, Huang Ying , Hugh Dickins , linux-kernel@vger.kernel.org, Chris Wilson , William Kucharski , Johannes Weiner , cgroups@vger.kernel.org, Andrew Morton , Alexey Dobriyan , Matthew Auld Date: Mon, 14 Sep 2020 12:47:26 -0400 In-Reply-To: References: <20200910183318.20139-1-willy@infradead.org> <20200910183318.20139-4-willy@infradead.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Rspamd-Queue-Id: C20CE18229818 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: On Mon, 2020-09-14 at 12:17 -0400, Qian Cai wrote: > On Thu, 2020-09-10 at 19:33 +0100, Matthew Wilcox (Oracle) wrote: > > Instead of calling find_get_entry() for every page index, use an XArray > > iterator to skip over NULL entries, and avoid calling get_page(), > > because we only want the swap entries. > > > > Signed-off-by: Matthew Wilcox (Oracle) > > Acked-by: Johannes Weiner > > Reverting the "Return head pages from find_*_entry" patchset [1] up to this > patch fixed the issue that LTP madvise06 test [2] would trigger endless soft- > lockups below. It does not help after applied patches fixed other separate > issues in the patchset [3][4]. Forgot to send this piece of RCU stall traces as well which might help debugging. 00: [ 2852.137748] madvise06 (62712): drop_caches: 3 01: [ 2928.208367] rcu: INFO: rcu_sched self-detected stall on CPU 01: [ 2928.210083] rcu: 1-....: (6499 ticks this GP) idle=036/1/0x4000000000 01: 000002 softirq=1741392/1741392 fqs=3161 01: [ 2928.210610] (t=6500 jiffies g=610849 q=12529) 01: [ 2928.210620] Task dump for CPU 1: 01: [ 2928.210630] task:madvise06 state:R running task stack:53320 pi 01: d:62712 ppid: 62711 flags:0x00000004 01: [ 2928.210676] Call Trace: 01: [ 2928.210693] [<00000000af57ec88>] show_stack+0x158/0x1f0 01: [ 2928.210703] [<00000000ae55b692>] sched_show_task+0x3d2/0x4c8 01: [ 2928.210710] [<00000000af5846aa>] rcu_dump_cpu_stacks+0x26a/0x2a8 01: [ 2928.210718] [<00000000ae64fa62>] rcu_sched_clock_irq+0x1c92/0x2188 01: [ 2928.210726] [<00000000ae6662ee>] update_process_times+0x4e/0x148 01: [ 2928.210734] [<00000000ae690c26>] tick_sched_timer+0x86/0x188 01: [ 2928.210741] [<00000000ae66989c>] __hrtimer_run_queues+0x84c/0x10b8 01: [ 2928.210748] [<00000000ae66c80a>] hrtimer_interrupt+0x38a/0x860 01: [ 2928.210758] [<00000000ae48dbf2>] do_IRQ+0x152/0x1c8 01: [ 2928.210767] [<00000000af5b00ea>] ext_int_handler+0x18e/0x194 01: [ 2928.210774] [<00000000ae5e332e>] arch_local_irq_restore+0x86/0xa0 01: [ 2928.210782] [<00000000af58da04>] lock_is_held_type+0xe4/0x130 01: [ 2928.210791] [<00000000ae63355a>] rcu_read_lock_held+0xba/0xd8 01: [ 2928.210799] [<00000000af0125fc>] xas_descend+0x244/0x2c8 01: [ 2928.210806] [<00000000af012754>] xas_load+0xd4/0x148 01: [ 2928.210812] [<00000000af014490>] xas_find+0x5d0/0x818 01: [ 2928.210822] [<00000000ae97e644>] do_madvise+0xd5c/0x1600 01: [ 2928.210828] [<00000000ae97f2d2>] __s390x_sys_madvise+0x72/0x98 01: [ 2928.210835] [<00000000af5af844>] system_call+0xdc/0x278 01: [ 2928.210841] 3 locks held by madvise06/62712: 01: [ 2928.216406] #0: 00000001437fca18 (&mm->mmap_lock){++++}-{3:3}, at: do_m 01: dvise+0x18c/0x1600 01: [ 2928.216430] #1: 00000000afbdd3e0 (rcu_read_lock){....}-{1:2}, at: do_mad 01: vise+0xe72/0x1600 01: [ 2928.216449] #2: 00000000afbe0818 (rcu_node_1){-.-.}-{2:2}, at: rcu_dump_ 01: cpu_stacks+0xb2/0x2a8