Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp6045485ybg; Tue, 22 Oct 2019 12:13:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeAwvxq8yYfewbMZoPXE4YrNmNr7GmnvOtxzgjHr3S3F4BVirmfAlxFKFLP3tDdssEGOZH X-Received: by 2002:a05:6402:68b:: with SMTP id f11mr6824548edy.173.1571771617251; Tue, 22 Oct 2019 12:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571771617; cv=none; d=google.com; s=arc-20160816; b=e+Suush1QHXzQur/T4RSIduBR+IL5rcf4gDrevtfF55UOL4xHoofCjihmRKc4MjEp3 lAbFJiixG/+dogd1MB/EEFVMR0Gdu7v3WMAHsSDq8I7QYl0B6QEFQExzFCfkWpIKQPQy S2GjbaZYPYlxBejGToKd9SirKqHW3K1r0zqTVrJRQsnJ6eGaTISwudE1L+SVZ5yAeR7Z 2uBW+aQMNcBgQM3i9Tsc8Y1mGnylNwfGTU3ifJHJs+0zdq55XUA0vap/0hOJ+f8IPuhl eRVAtIUEoCamEPX5W5lK4Tjm0+ffHvpyi+aofZQD/Ghu+7UWkF2NnDHKypWT6/tGzor6 zoQA== 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=MNPPC1PPg3XJFEcS0GKtdtPTBx5GIjNdnRLYKgcp7kI=; b=CPs+b1HNu5B//daHlGvetNLqsAgFSiauDH0y+6r0jRXa5ZAPJGbxHoEzjsR+nS2bs1 wEq0YCpojsH1/2UhNq85Imq04G65UCT9NiCfORR280nhZwA+ZSQPtkMRlxR4tNUMhAyr SrZIJ8jDSfxushZW8/ron7k2Q2wZWDq1adEY9WN7gW3NYlfkPU/RQqAc/G89FjCQCzeG qYUVRAwXxTeSkpC3uW81oJVZzhOBUwb37AzD0OE8qIhsIKJT+2iaiYfhdzRWP8VTPlEZ ECEiqIZ4zfU/Uo0rQ6Nj4c06L8CwXY4j0iaXy9mOi9PFvL1Yt3aaczqhic8SIXQbK23Q WxiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ey3dmNkS; 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 j3si14433023edj.448.2019.10.22.12.13.13; Tue, 22 Oct 2019 12:13:37 -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=ey3dmNkS; 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 S1732959AbfJVTM0 (ORCPT + 99 others); Tue, 22 Oct 2019 15:12:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:43400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732903AbfJVTMZ (ORCPT ); Tue, 22 Oct 2019 15:12:25 -0400 Received: from localhost.localdomain (rrcs-50-75-166-42.nys.biz.rr.com [50.75.166.42]) (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 CD91521929; Tue, 22 Oct 2019 19:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571771544; bh=inhfkOQ9xIrGDaCXR3ixnBd1vmXaWhpuxLRSRAKlsWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ey3dmNkSSy9+VhZatSefvVHUlOQmRmf4ayTRDRoEl0yBjeL/KIK7JUHddhoroBK62 ss5alIYeXVCEvv042Mn3H42RH3aZI8KvX3I2u9bcn8Y3VMiNkOpU/HxNz7lLE0keP3 YgBhVpFNXO8jbnlFi7Ai0xppgCT17WZXccEuJZ5A= 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 03/10] drivers/gpu: Replace rcu_swap_protected() with rcu_replace() Date: Tue, 22 Oct 2019 12:12:08 -0700 Message-Id: <20191022191215.25781-3-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191022191136.GA25627@paulmck-ThinkPad-P72> References: <20191022191136.GA25627@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 [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] 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..3f3e803 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_pointer(ctx->engines, set.engines, 1); mutex_unlock(&ctx->engines_mutex); call_rcu(&set.engines->rcu, free_engines_rcu); -- 2.9.5