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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF6FAC433EF for ; Thu, 10 Mar 2022 20:17:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22B0B8D0002; Thu, 10 Mar 2022 15:17:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D9CC8D0001; Thu, 10 Mar 2022 15:17:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07A628D0002; Thu, 10 Mar 2022 15:17:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id E95EB8D0001 for ; Thu, 10 Mar 2022 15:17:21 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AD9BF181CAC4C for ; Thu, 10 Mar 2022 20:17:21 +0000 (UTC) X-FDA: 79229586282.17.9FB6AA4 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id B21452001E for ; Thu, 10 Mar 2022 20:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ITG4Xtz65L2rag/5JXLdSAm3BLtxyCn4F8gMXSD28zU=; b=Vw7BRQf0SrRTEpQIJBzMXdDIhb J9q7eP6yAuhaQDzxGtgNI5sjXUcfJ4pE86iMoO7Bo497zAg1QJ79M0gHYNbVx1ldFkM1EVIzACf82 hVzC5NxmFXez+CSGcv8RUwgGNEljY84MjY2jn1ZGXwwZbSRBxHPf1vnURkzLjOqsib62raz5GBn7/ IbK12fI8YDLjK8BbAanVKvv7jjGHDzivSgRcpJ6iDNao0bzdWkLKV7smcGCetBWQaDO4LElRkcaPx 9NpU8/kcJ4bQHMlGt1uSXQEJyIeysneQx6QNuvVAe5jGmcazeTU+8L1AaOtnMqMW354SFbc2sFC8C P0ChBz+w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSPDM-000tjC-6z; Thu, 10 Mar 2022 20:16:48 +0000 Date: Thu, 10 Mar 2022 20:16:48 +0000 From: Matthew Wilcox To: David Rientjes Cc: Yang Shi , Zach O'Keefe , Alex Shi , David Hildenbrand , Michal Hocko , Pasha Tatashin , SeongJae Park , Song Liu , Vlastimil Babka , Zi Yan , Linux MM , Andrea Arcangeli , Andrew Morton , Arnd Bergmann , Axel Rasmussen , Chris Kennelly , Chris Zankel , Helge Deller , Hugh Dickins , Ivan Kokshaysky , "James E.J. Bottomley" , Jens Axboe , "Kirill A. Shutemov" , Matt Turner , Max Filippov , Miaohe Lin , Minchan Kim , Patrick Xia , Pavel Begunkov , Peter Xu , Richard Henderson , Thomas Bogendoerfer Subject: Re: [RFC PATCH 12/14] mm/madvise: introduce batched madvise(MADV_COLLPASE) collapse Message-ID: References: <20220308213417.1407042-1-zokeefe@google.com> <20220308213417.1407042-13-zokeefe@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B21452001E X-Stat-Signature: qgqsmj6hwzcodc8rike464n4eqtxia1d Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Vw7BRQf0; 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; dmarc=none X-HE-Tag: 1646943440-595692 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 Thu, Mar 10, 2022 at 11:26:15AM -0800, David Rientjes wrote: > One concern might be the queueing of read locks needed for page faults > behind a collapser of a long range of memory that is otherwise looping > and repeatedly taking the write lock. I would have thought that _not_ batching would improve this situation. Unless our implementation of rwsems has changed since the last time I looked, dropping-and-reacquiring a rwsem while there are pending readers means you go to the end of the line and they all get to handle their page faults.