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 56E93C433DF for ; Wed, 20 May 2020 02:17:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B1A32070A for ; Wed, 20 May 2020 02:17:44 +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="SHa+IiwX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B1A32070A 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 9FD4A80041; Tue, 19 May 2020 22:17:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9ACAA8002C; Tue, 19 May 2020 22:17:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C2BD80041; Tue, 19 May 2020 22:17:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 710F98002C for ; Tue, 19 May 2020 22:17:43 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1F050180AD807 for ; Wed, 20 May 2020 02:17:43 +0000 (UTC) X-FDA: 76835486406.25.bun56_92455a20d554 X-HE-Tag: bun56_92455a20d554 X-Filterd-Recvd-Size: 3029 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 May 2020 02:17:42 +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=N7C43Aypkl4EuAArMN9J7yHFw5De5vjIxhJuuufeovY=; b=SHa+IiwXztgGsH7VEAQ0viqZge 9VPm1sug2ZvRhSOglws8QaCocuXnMZg3uz5WQ6ephAnw+VfUf5lUOR7KxziTtmmLiqdhUhj7JMyxi jKAohwAngQgnj23Vg12wTw/zoukaNWtQhQ56Rk5E8TVVPyVAgnaHgVnv1n1CcNjLYIiLdmLxxTNdm 11lZYQ+VWgrSerIddpCbdv0GNI2BjCYsBA36Q9AVCjY+KG/B4DsJndi7I+Fghujn7UEH0/U5p9hYi gZzi518dTeo/9Q4/JGPcJGnCbrVXyR2ttl7Aw6Ona4NFzWNJtxLgHN874ofPdqibSpjcfAXM4h9Ax VP3V43mw==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbEIc-0004YP-8V; Wed, 20 May 2020 02:17:38 +0000 Date: Tue, 19 May 2020 19:17:38 -0700 From: Matthew Wilcox To: Andrew Morton Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Steven Rostedt , Will Deacon , Thomas Gleixner , "Paul E . McKenney" , Linus Torvalds , linux-mm@kvack.org Subject: Re: [PATCH 4/8] mm/swap: Use local_lock for protection Message-ID: <20200520021738.GC16070@bombadil.infradead.org> References: <20200519201912.1564477-1-bigeasy@linutronix.de> <20200519201912.1564477-5-bigeasy@linutronix.de> <20200519165837.883035d3228c582b9bff1d77@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200519165837.883035d3228c582b9bff1d77@linux-foundation.org> 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 Tue, May 19, 2020 at 04:58:37PM -0700, Andrew Morton wrote: > On Tue, 19 May 2020 22:19:08 +0200 Sebastian Andrzej Siewior wrote: > > + local_lock(swapvec_lock); > > It's quite peculiar that these operations appear to be pass-by-value. > All other locking operations are pass-by-reference - spin_lock(&lock), > not spin_lock(lock). This is what the eye expects to see and it's > simply more logical - calling code shouldn't have to "know" that the > locking operations are implemented as cpp macros. And we'd be in a > mess if someone tried to convert these to real C functions. The funny thing is that the documentation gets this right: +The mapping of local_lock to spinlock_t on PREEMPT_RT kernels has a few +implications. For example, on a non-PREEMPT_RT kernel the following code +sequence works as expected:: + + local_lock_irq(&local_lock); + raw_spin_lock(&lock); but apparently the implementation changed without the documentation matching.