Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1559012ybn; Wed, 2 Oct 2019 18:45:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgnccma0lsiXCQs8AJOhpET9ZrlHt17uy/hdtWNaSO5VqgWmoEI/AzTfar6AFMaJI9GbuS X-Received: by 2002:a50:af26:: with SMTP id g35mr7218534edd.129.1570067149156; Wed, 02 Oct 2019 18:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570067149; cv=none; d=google.com; s=arc-20160816; b=XKwqor/7KKCKO4BjUu4S7XqhlDOb7xFgspB26Q4prLM9NDNj5oIEU/MWqIlinQpEwu T4CSM4slxw974GXqOUkB2QU3AX0WUqgX8jfNboPSxIdBa5NJbRl85FaKgjJPsMMh7o18 Iw30hdSHkcOonEK9q/b62BcJSsdRIIA87s4+Ccs/UDch+ka08c6jQ6nBeXUm6kPeNCOi Q0UZYC2oWCBe8Ge3uJGmw56v4vDPnYnLzHxKaIji9+GDTS/H76jWFILwd2D4fhlTOHNP I2ovGGD6TXIz+FXzCjVKioa7BXY2HWkcGRFOQt4EY9SXL+miIGjqvyPcklfWiCLKHaA9 VI4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=4icezxZq8PvRbMZkNGoH//jr6inXbEZyoF/9DZhj5R4=; b=e0Y7WR4IOAVZcqjEC6mzskGTmVbYY58RGRQ0iPqCy02lffO9cjSEaaS3/YlBvkO3AG qZQC/vUe/V6uMBCfVy/aQapiE0pxAYxInZ3N8cHk8VLZpiIq/6kYH1LnWalMjZpxpSux GFcd8guamm39LZm0NoSGXP8pCQD9ejDFh6yx/PKLo/WJG+RP4+rOZy/kUfV2pRmq7PFP 11biJNLbC+g0y75klXK5XNyN1HDAnzSMfB2RVV0P3rPYJYlUs4nCop1YSnY940tz73Nd 1PC6xZ+K+PMdGb1oDgwX26I2gT/rkoWMu+CxjHBdZoEO/VKjJUBZxTh/HGkd2TpwDOXH slvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aR9o0x1N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si559732edb.258.2019.10.02.18.45.25; Wed, 02 Oct 2019 18:45:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aR9o0x1N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbfJCBnO (ORCPT + 99 others); Wed, 2 Oct 2019 21:43:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:46392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfJCBnN (ORCPT ); Wed, 2 Oct 2019 21:43:13 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78982222CA; Thu, 3 Oct 2019 01:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570066992; bh=pecg14+rqKCe9+MU1znEqt1dgbZQC6DApkD13yS7z0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aR9o0x1NHONIbxPoNOj8+Ux2ZBnn1MPxi/Eaxd2edaSTIw39ipumC3Ndu4BXSFyag 7fSr1WKYBdYOcypMBAqTPl1y4f/M7W09FmEOoeFeg1kOl/FnKZ/PvU9nzUhm//Smok Za9vci8Sk49LJWA2iNQ8Knf/e7tHAtyDSW+QF1uQ= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH tip/core/rcu 3/9] drivers/gpu: Replace rcu_swap_protected() with rcu_replace() Date: Wed, 2 Oct 2019 18:43:04 -0700 Message-Id: <20191003014310.13262-3-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191003014153.GA13156@paulmck-ThinkPad-P72> References: <20191003014153.GA13156@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" This commit replaces the use of rcu_swap_protected() with the more intuitively appealing rcu_replace() as a step towards removing rcu_swap_protected(). Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/ Reported-by: Linus Torvalds Signed-off-by: Paul E. McKenney Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: David Airlie Cc: Daniel Vetter Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: Cc: --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index 1cdfe05..c5c22c4 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -1629,7 +1629,7 @@ set_engines(struct i915_gem_context *ctx, i915_gem_context_set_user_engines(ctx); else i915_gem_context_clear_user_engines(ctx); - rcu_swap_protected(ctx->engines, set.engines, 1); + set.engines = rcu_replace(ctx->engines, set.engines, 1); mutex_unlock(&ctx->engines_mutex); call_rcu(&set.engines->rcu, free_engines_rcu); -- 2.9.5