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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 BB6EFC433E0 for ; Mon, 25 May 2020 15:45:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7AF732053B for ; Mon, 25 May 2020 15:45:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rfWUQphX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AF732053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 101038E0011; Mon, 25 May 2020 11:45:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 08B478E0008; Mon, 25 May 2020 11:45:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E93E28E0011; Mon, 25 May 2020 11:45:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id CDFE08E0008 for ; Mon, 25 May 2020 11:45:21 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7D708181AC9CB for ; Mon, 25 May 2020 15:45:21 +0000 (UTC) X-FDA: 76855665642.20.plate17_4bd981c972712 X-HE-Tag: plate17_4bd981c972712 X-Filterd-Recvd-Size: 3418 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 May 2020 15:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=TnVCZhEhDgEId/ne5umjodioE98Nb5LpIywLtK4Uy8Y=; b=rfWUQphXFwBLdziX8VTeEHMveF OwjrVTxX95J5/L6rS7shpvVH0eSY7g669NRuNnscfX9zEm42O2U8FeCeVuJMj3FbkhBHgIShaGvBn MMv0o/JvtmviNMSw1V02i0xP7+SIt3P3Xj2Cy3tqz92XDPvSU4QgML1p8LpIddILAhFuYmJUhmg1P d2GTV2lKc7tZv/ovG13C79GCEgEn0tB07QpanhytIXMg2A2T1HW92/DR+niSO5HYDHD52b4RM+NkY 6SQjHJrOrAFj0q/2vE3iM2OWUa/CSi0wd+vgruCH1c4LOQ/NVM08i6Kk7p45HGL57n+Fj7pFCb8Jo LiRyXYGg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdFHp-0007Mq-0W; Mon, 25 May 2020 15:45:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7FAD1300B38; Mon, 25 May 2020 17:45:06 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0D0A120BD4F38; Mon, 25 May 2020 17:45:06 +0200 (CEST) Date: Mon, 25 May 2020 17:45:05 +0200 From: Peter Zijlstra To: "Ahmed S. Darwish" Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , Steven Rostedt , LKML , Andrew Morton , Konstantin Khlebnikov , linux-mm@kvack.org Subject: Re: [PATCH v1 02/25] mm/swap: Don't abuse the seqcount latching API Message-ID: <20200525154505.GZ325280@hirez.programming.kicks-ass.net> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200519214547.352050-3-a.darwish@linutronix.de> <20200522145707.GO325280@hirez.programming.kicks-ass.net> <20200525152401.GA375786@debian-buster-darwi.lab.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525152401.GA375786@debian-buster-darwi.lab.linutronix.de> 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, May 25, 2020 at 05:24:01PM +0200, Ahmed S. Darwish wrote: > Peter Zijlstra wrote: > > On Tue, May 19, 2020 at 11:45:24PM +0200, Ahmed S. Darwish wrote: > > > + WRITE_ONCE(lru_drain_gen, lru_drain_gen + 1); > > > + smp_wmb(); > > > > You can leave this smp_wmb() out and rely on the smp_mb() implied by > > queue_work_on()'s test_and_set_bit(). > > > > Won't this be too implicit? > > Isn't it possible that, over the years, queue_work_on() impementation > changes and the test_and_set_bit()/smp_mb() gets removed? > > If that happens, this commit will get *silently* broken and the local > CPU pages won't be drained. Add a comment to queue_work_on() that points here? That way people are aware.