From patchwork Tue Aug 6 15:01:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 11085751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07EC614F7 for ; Fri, 9 Aug 2019 09:16:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E92DD28B38 for ; Fri, 9 Aug 2019 09:16:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDC3F28C3E; Fri, 9 Aug 2019 09:16:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5C9D28C1E for ; Fri, 9 Aug 2019 09:16:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1557C6ED5F; Fri, 9 Aug 2019 09:15:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 003D76E3BB; Tue, 6 Aug 2019 15:01:41 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id p17so88224964wrf.11; Tue, 06 Aug 2019 08:01:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e09g/esR6Gc/6veKI4tptZ2siOvKJFGhd59QLPFyqW4=; b=ajsnRlvkyF5Ek7/ckfgBOPNEd9NDNJAOcehfPHQtok2TqIVvYRAdLVLAQoasIxCvFY XiZdihXMdW5+QQbYUIsaxb5LGDtG5405Rei0NjfaYzWHGCoONUq0ioYggX37KJLrUDkg Cy5zsF617kR4DGY4xdl6SFbA3sazbjIUfZfkFtHenC+td2DrDeBJtxe74RE3Bf2UdWRf atKbV0qxCVB3kgspB8ccXnl4H1U08RBcHeYF9IWhIFCdEwXvsv16gBPmDMIY0n35MvVL UTmFojCQyxXdEVZBjlq+V5AqQdw+srRGm88JnME8/UkBrmpF9kKMEdze8H8SjvVDhdaP sdXA== X-Gm-Message-State: APjAAAXAYTskv1ud1xeCUbPNbrGOapMrSNUvYvC5y3QqBN3Lxf070gsH 20WB5g0Jlno1/+tzKJegWUMV0ZGm X-Google-Smtp-Source: APXvYqxKVmwwaUkn9/+Ffdy8aAG3yGbikgU2djIIvoaLAmTQLo3pQr2c0LuucLBpvEKnEuOoSutCEw== X-Received: by 2002:a05:6000:112:: with SMTP id o18mr5520412wrx.153.1565103699969; Tue, 06 Aug 2019 08:01:39 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:d1e0:fffc:b0e3:c66d]) by smtp.gmail.com with ESMTPSA id g2sm78766828wmh.0.2019.08.06.08.01.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 08:01:39 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: intel-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk Date: Tue, 6 Aug 2019 17:01:31 +0200 Message-Id: <20190806150134.104222-5-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806150134.104222-1-christian.koenig@amd.com> References: <20190806150134.104222-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 09 Aug 2019 09:15:44 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=e09g/esR6Gc/6veKI4tptZ2siOvKJFGhd59QLPFyqW4=; b=fpcKxPtS0XqaSscchhZzfKShzEYp2CXEXkpNM3xgvfd0gYScSfd1ebPFxlAZ8n00an JEOf5YYhrMtgIMiS8uQY1IY6bQZF0SKw77BpdcSK5sPC7iz8QZ+6po6sOL2tHfz7zVgi rQ4c7u+/m8Dlnym45AfqwQ2r5uU1mM9KLpfQT+qdyNVYxpXvpNhsuXrP2R/oaJYM49to ytR0v24YUPxTsc1U1nK1M7y/+gFzRrtF6aBBk/fx+zoOMiG9iAxgnH5m+UKWjgd7HWKT dxgLpgZrM+d2t4jGyxURXtS2Z3ghOlOPKOTHwHSYmhB0TM6jSAftcGhvb3JmAwHUoE+Y IsxQ== Subject: [Intel-gfx] [PATCH 5/8] dma-buf: further relax reservation_object_add_shared_fence X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Other cores don't busy wait any more and we removed the last user of checking the seqno for changes. Drop updating the number for shared fences altogether. Signed-off-by: Christian König --- drivers/dma-buf/reservation.c | 6 ------ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 7 +------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index c0ba05936ab6..944d962ddddf 100644 --- a/drivers/dma-buf/reservation.c +++ b/drivers/dma-buf/reservation.c @@ -237,9 +237,6 @@ void reservation_object_add_shared_fence(struct reservation_object *obj, fobj = reservation_object_get_list(obj); count = fobj->shared_count; - preempt_disable(); - write_seqcount_begin(&obj->seq); - for (i = 0; i < count; ++i) { old = rcu_dereference_protected(fobj->shared[i], @@ -257,9 +254,6 @@ void reservation_object_add_shared_fence(struct reservation_object *obj, RCU_INIT_POINTER(fobj->shared[i], fence); /* pointer update must be visible before we extend the shared_count */ smp_store_mb(fobj->shared_count, count); - - write_seqcount_end(&obj->seq); - preempt_enable(); dma_fence_put(old); } EXPORT_SYMBOL(reservation_object_add_shared_fence); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index fe062b76ec91..a4640ddc24d1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -251,12 +251,7 @@ static int amdgpu_amdkfd_remove_eviction_fence(struct amdgpu_bo *bo, new->shared_max = old->shared_max; new->shared_count = k; - /* Install the new fence list, seqcount provides the barriers */ - preempt_disable(); - write_seqcount_begin(&resv->seq); - RCU_INIT_POINTER(resv->fence, new); - write_seqcount_end(&resv->seq); - preempt_enable(); + rcu_assign_pointer(resv->fence, new); /* Drop the references to the removed fences or move them to ef_list */ for (i = j, k = 0; i < old->shared_count; ++i) {