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, INCLUDES_PATCH,MAILING_LIST_MULTI,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 BAC98C43461 for ; Mon, 14 Sep 2020 19:44:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3607B2193E for ; Mon, 14 Sep 2020 19:44:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IvYCSbzb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3607B2193E 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 679356B0003; Mon, 14 Sep 2020 15:44:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6284D6B0055; Mon, 14 Sep 2020 15:44:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 564E16B005D; Mon, 14 Sep 2020 15:44:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 404356B0003 for ; Mon, 14 Sep 2020 15:44:49 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 01963180AD80F for ; Mon, 14 Sep 2020 19:44:49 +0000 (UTC) X-FDA: 77262694698.12.sink37_08100482710b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id C05CA18054D2D for ; Mon, 14 Sep 2020 19:44:48 +0000 (UTC) X-HE-Tag: sink37_08100482710b X-Filterd-Recvd-Size: 3693 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Mon, 14 Sep 2020 19:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600112687; 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=A/DjrjveF5/2wA8RTl0T9a0Cox1J1OLY+rMuhaYpfao=; b=IvYCSbzbKtHcWk641z4V6pc/0EIZUDRefpKVuMBpk64oqv+50TPjr7TAIkcKbP0KPGcEhg Iwk+U+1JE1Xn+EThiI4akshLgS4SRkZx2n6S1QeWncHZtFHMNDsDsJfvv0xoPeDZLak349 hwly5WBKQ+cilcrGinIrZlcCOFpXEzQ= 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-210-JgGmMpLmOG2xlwIrBHTevw-1; Mon, 14 Sep 2020 15:44:43 -0400 X-MC-Unique: JgGmMpLmOG2xlwIrBHTevw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 773238015AA; Mon, 14 Sep 2020 19:44:41 +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 ACF737513E; Mon, 14 Sep 2020 19:44:39 +0000 (UTC) Message-ID: <05803c18b64db8a811c692bcbdc03172935ea483.camel@redhat.com> Subject: Re: [PATCH v2 3/8] mm: Optimise madvise WILLNEED From: Qian Cai To: Matthew Wilcox Cc: linux-mm@kvack.org, 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 15:44:39 -0400 In-Reply-To: <20200914165032.GS6583@casper.infradead.org> References: <20200910183318.20139-1-willy@infradead.org> <20200910183318.20139-4-willy@infradead.org> <20200914165032.GS6583@casper.infradead.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Rspamd-Queue-Id: C05CA18054D2D 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 17:50 +0100, Matthew Wilcox wrote: > On Mon, Sep 14, 2020 at 12:17:07PM -0400, Qian Cai wrote: > > 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]. > > Thanks for the report. Could you try this? It works fine. > > diff --git a/mm/madvise.c b/mm/madvise.c > index 96189acd6969..2d9ceccb338d 100644 > --- a/mm/madvise.c > +++ b/mm/madvise.c > @@ -234,6 +234,7 @@ static void force_shm_swapin_readahead(struct > vm_area_struct *vma, > > if (!xa_is_value(page)) > continue; > + xas_pause(&xas); > rcu_read_unlock(); > > swap = radix_to_swp_entry(page); > @@ -243,7 +244,6 @@ static void force_shm_swapin_readahead(struct > vm_area_struct *vma, > put_page(page); > > rcu_read_lock(); > - xas_reset(&xas); > } > rcu_read_unlock(); > >