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 63852C433EF for ; Tue, 22 Feb 2022 16:08:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E97A98D0005; Tue, 22 Feb 2022 11:08:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E48498D0003; Tue, 22 Feb 2022 11:08:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D36248D0005; Tue, 22 Feb 2022 11:08:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id C47CF8D0003 for ; Tue, 22 Feb 2022 11:08:29 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A19EF211F4 for ; Tue, 22 Feb 2022 16:08:29 +0000 (UTC) X-FDA: 79170898338.09.0A87FE9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 22C0D100010 for ; Tue, 22 Feb 2022 16:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645546108; 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: in-reply-to:in-reply-to:references:references; bh=ayZQO14IuVvLb4KFAu15b92K05gesQyRdVPfr8lUqdY=; b=MWhD7hl05/eINDT3h9XfiwjwYkHnbd7z8CYR9xvh5RN+O5jyMq+P2tBqWh/24EdZeV4X62 IFFtY8sGKy2R8q8OpQhz7huSFDini/JdH95HBGnpeZNZ+LUQm5e4EXs+JcYq3O64bd3dAG VURwAEqNZZN4L/XOIJMO0dH8FT264T4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-517-MG6RiG2uMxy0URq4p3XVmw-1; Tue, 22 Feb 2022 11:08:25 -0500 X-MC-Unique: MG6RiG2uMxy0URq4p3XVmw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0987A188E3C2; Tue, 22 Feb 2022 16:08:24 +0000 (UTC) Received: from fuller.cnet (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DD4282765; Tue, 22 Feb 2022 16:08:00 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id D5215416D862; Tue, 22 Feb 2022 12:51:51 -0300 (-03) Date: Tue, 22 Feb 2022 12:51:51 -0300 From: Marcelo Tosatti To: Nicolas Saenz Julienne Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Matthew Wilcox , Mel Gorman , Juri Lelli , Thomas Gleixner , Sebastian Andrzej Siewior , "Paul E. McKenney" Subject: Re: [patch 1/2] mm: protect local lock sections with rcu_read_lock (on RT) Message-ID: References: <20220222144706.937848439@redhat.com> <20220222144907.023121407@redhat.com> <5f96c7e306546af4604cfaddb895a089811cb99b.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f96c7e306546af4604cfaddb895a089811cb99b.camel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 22C0D100010 X-Stat-Signature: 19rwr8sfstdy5fpxoz49y785t7fwutak Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MWhD7hl0; spf=none (imf05.hostedemail.com: domain of mtosatti@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1645546109-209767 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, Feb 22, 2022 at 04:21:26PM +0100, Nicolas Saenz Julienne wrote: > On Tue, 2022-02-22 at 11:47 -0300, Marcelo Tosatti wrote: > > For the per-CPU LRU page vectors, augment the local lock protected > > code sections with rcu_read_lock. > > > > This makes it possible to replace the queueing of work items on all > > CPUs by synchronize_rcu (which is necessary to run FIFO:1 applications > > uninterrupted on isolated CPUs). > > I don't think this is needed. In RT local_locks use a spinlock. See > kernel/locking/spinlock_rt.c: > > "The RT [spinlock] substitutions explicitly disable migration and take > rcu_read_lock() across the lock held section." Nice! Then the migrate_disable from __local_lock and friends seems unnecessary as well #define __local_lock(__lock) \ do { \ migrate_disable(); \ spin_lock(this_cpu_ptr((__lock))); \ } while (0) Since: static __always_inline void __rt_spin_lock(spinlock_t *lock) { rtlock_might_resched(); rtlock_lock(&lock->lock); rcu_read_lock(); migrate_disable(); } Will resend -v2.