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 5E970C433EF for ; Tue, 22 Feb 2022 16:17:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E193F8D0005; Tue, 22 Feb 2022 11:16:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC8618D0003; Tue, 22 Feb 2022 11:16:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C90B78D0005; Tue, 22 Feb 2022 11:16:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id BBEF38D0003 for ; Tue, 22 Feb 2022 11:16:59 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7F2809676C for ; Tue, 22 Feb 2022 16:16:59 +0000 (UTC) X-FDA: 79170919758.16.E917F26 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 2CA40C0008 for ; Tue, 22 Feb 2022 16:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645546618; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DcDTSDbLiZYgGC8YhFYfluc7f+Em6a/9jzmbqQfcKtU=; b=VSJTQlrVGL68glPwgscfvRrU7B/mL8Tm551YYRLTFbvAF0U+X6QWejc/Q9BqFh/XPzTBkw VM5equtG2KOxMrBgS5HP/QpuXENqErdmx1rW0Eki/URxIeqFi4jbozRdMfRZ0Lc6I7yIhS ig+JS1vk9kfznKJqoam569Bko5zLtgo= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-32-1mYe5HPcMuu0ClXZZy2NrA-1; Tue, 22 Feb 2022 11:16:56 -0500 X-MC-Unique: 1mYe5HPcMuu0ClXZZy2NrA-1 Received: by mail-wm1-f70.google.com with SMTP id 130-20020a1c0288000000b0037fae68fcc2so1050329wmc.8 for ; Tue, 22 Feb 2022 08:16:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DcDTSDbLiZYgGC8YhFYfluc7f+Em6a/9jzmbqQfcKtU=; b=3BrW9aYFTZY7dKik7fogTKtMFetNYnL09v/x0h5lBiagDbEEGlgpkMTGv8hjC1tJDh 1u5AKNc28Y12IJ55g8D4jbblCCIvi5RgYbJ3SukRsFXWbgr5FBiYoRvPsMhSkf/cBDwG yx7dSW5trThZTtcZsXnedK+iWz4rdQ3o/LaB6ATwaQk1lgfNxPsF/wOU3o3ucI4dXfuL HLI5eTjxKbKsNyqYYJowZN+VIxksrlnjY3Loi3WYG6XKul2cr2axQbZELkEkjLMVQbvm MwRzknUbIcJp+eSNMB4jb1wlwlrhjIsDEiY42WcqWW28llPA0uTIoJJILjVtwwPQFdWS narw== X-Gm-Message-State: AOAM530rAP+jDaScGwhdNDBB84LC0E+KRvSnP4GWz18FGQjzzipxwKlQ ps2qsUz8nLOWR8jkhEU3xRYofz+bJa0cp9/fChoUKrRhHVHZ/94B0WPE4DPui6rkPRGUm6DfviH chYGJhEam0Ak= X-Received: by 2002:adf:ba8f:0:b0:1e9:4afb:179b with SMTP id p15-20020adfba8f000000b001e94afb179bmr15601794wrg.57.1645546614936; Tue, 22 Feb 2022 08:16:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyThEU7QPElbkNMLqPCYNmo2W/qlX4MGgKFIqLhioQUq+UurFeWt5wGJoy3B/oRfP18q5F+ZQ== X-Received: by 2002:adf:ba8f:0:b0:1e9:4afb:179b with SMTP id p15-20020adfba8f000000b001e94afb179bmr15601772wrg.57.1645546614722; Tue, 22 Feb 2022 08:16:54 -0800 (PST) Received: from ?IPv6:2a0c:5a80:1204:1500:37e7:8150:d9df:36f? ([2a0c:5a80:1204:1500:37e7:8150:d9df:36f]) by smtp.gmail.com with ESMTPSA id 14sm25944252wrb.34.2022.02.22.08.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 08:16:54 -0800 (PST) Message-ID: <601c504a381de76d6e39ae2fe86456c411c8b62e.camel@redhat.com> Subject: Re: [patch 1/2] mm: protect local lock sections with rcu_read_lock (on RT) From: Nicolas Saenz Julienne To: Marcelo Tosatti 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" Date: Tue, 22 Feb 2022 17:16:53 +0100 In-Reply-To: References: <20220222144706.937848439@redhat.com> <20220222144907.023121407@redhat.com> <5f96c7e306546af4604cfaddb895a089811cb99b.camel@redhat.com> User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VSJTQlrV; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf22.hostedemail.com: domain of nsaenzju@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=nsaenzju@redhat.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2CA40C0008 X-Stat-Signature: u5qcajfmj1g5tq11uiocwk1rzmxxc89h X-HE-Tag: 1645546619-234808 Content-Transfer-Encoding: quoted-printable 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, 2022-02-22 at 12:51 -0300, Marcelo Tosatti wrote: > 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. > > >=20 > > > This makes it possible to replace the queueing of work items on all= =20 > > > CPUs by synchronize_rcu (which is necessary to run FIFO:1 applicati= ons > > > uninterrupted on isolated CPUs). > >=20 > > I don't think this is needed. In RT local_locks use a spinlock. See > > kernel/locking/spinlock_rt.c: > >=20 > > "The RT [spinlock] substitutions explicitly disable migration and tak= e > > rcu_read_lock() across the lock held section." >=20 > Nice! Then the migrate_disable from __local_lock and friends seems unne= cessary as > well > > #define __local_lock(__lock) \ > do { \ > migrate_disable(); \ > spin_lock(this_cpu_ptr((__lock))); \ > } while (0) >=20 It's needed as you might migrate between: cpu1_lock =3D this_cpu_ptr(__lock); // migrate here to cpu2 spin_lock(cpu1_lock); // unprotected write into cpu2 lists Regards, --=20 Nicol=C3=A1s S=C3=A1enz