Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp182341pxm; Tue, 22 Feb 2022 08:33:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9DeefqQofCVkK1v1f5PVw9pEjgMHY/CibC6eB9u237qMVdOdyEr0+QxIjmJlYUGwHO2vO X-Received: by 2002:a62:6287:0:b0:4e0:cf48:e6ae with SMTP id w129-20020a626287000000b004e0cf48e6aemr25602682pfb.30.1645547589875; Tue, 22 Feb 2022 08:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645547589; cv=none; d=google.com; s=arc-20160816; b=GeEb2LeLPU3b2skxGJ2iUlC0uRgZ/hoGuD5ZnfmitiyPfx8IuhH+oyucE8q6x4uTPC NVVqhjosJ6y5CxiVW6XIprhpajy9lZNpYq9II+MMthBeZ+V6dCevuJWqJYlL7/wtZWUA 4rjf732iH9BtVc55yU/CM7j3gbmXmYYlCHD8tzZLpn9qDulWIcJetb7UEThXlQZZqKqy J02nZWc4IHNiHb1U26NVzs7V7f817Bm+FRmbxyaUYdBDCTW0IWdIkLj/MnHGsagKhv4R coWYmoBCnjLjBfhU38TBd8dDOqkOI6h475VrgA/9mttQZWYdtXGdHv3Apd1ImeFaxU/e fIpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ayZQO14IuVvLb4KFAu15b92K05gesQyRdVPfr8lUqdY=; b=Mvf+Hw0h4zkuRm4vLNLAJ0PGMZ28Y/PNTGASX10HkQHb2Kagn2BDYbBfSr+ViCfAFX RVXFODqHu6bVh6i/Ne1J0K5+CHUXfcFKl8b91k5KP11JjpccnVsWtApjeBrllCnUlC4H sFzCHJH9p3gjdFM5PnKnoM26fsSqi5RYUJ1v2lFaIu8iWOVWqJ7ksOxkUpKslwFbklOG 2zcgxY96wwQS1n8ytp1orjOpRSNgk9EsRIcCgof+4qSEXJ5EvTyz0qXD9fa58sB1ANJf CZc0goTmNbLGLr2I5yG1wjT7GbPUCr+juMBmElBsCiRw6Fy4jRV4vIuaK2LpKGuIBu6v hq1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MWhD7hl0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16si24323790plf.69.2022.02.22.08.32.47; Tue, 22 Feb 2022 08:33:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MWhD7hl0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233535AbiBVQI7 (ORCPT + 99 others); Tue, 22 Feb 2022 11:08:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233912AbiBVQI5 (ORCPT ); Tue, 22 Feb 2022 11:08:57 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA39D165C07 for ; Tue, 22 Feb 2022 08:08:29 -0800 (PST) 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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.