From patchwork Wed Aug 7 13:53:11 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: 11085769 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 70C6A912 for ; Fri, 9 Aug 2019 09:16:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60B5B28B38 for ; Fri, 9 Aug 2019 09:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5536328C3E; Fri, 9 Aug 2019 09:16:37 +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 04A2028B38 for ; Fri, 9 Aug 2019 09:16:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 71DEA6ED7D; Fri, 9 Aug 2019 09:15:51 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8DA36E6F1; Wed, 7 Aug 2019 13:53:16 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id f17so134051wme.2; Wed, 07 Aug 2019 06:53:16 -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=cJze+NHLGVWRPTthMI0DgfPkje+BdJ75ftz5VrySl6s=; b=aKozmWO5lzZhomR6Bfmw0NpeaNmerIXg41XeF9G9o+VrkYrnjMKWaRxzqjPm4emHCa c9rLf92Wd0YbAhIhHHDMmyQ+m6oAZr5GFcPZGM6W3DnVUzrpFiLLpbGq9r18PrkRdg9F aUJ29lpM6C/RXAPmXxg0mH9aSKkX1ZT5NX6o9BNLw86weNdljbh1kQWh12xs9qhrdH8i OLqwKKNC/EW27+UqiP8ivVb4M1Ome/XZI2K41GcXykp8Ez4M42ZX+slfKON3HZYycjM4 3b3IMiGNwbyKBlRRf9iGSEP2fPNE8q3bHqzPfEibLX8lGyr8Dva2SiOU5sPXuQMs8ReW lmVA== X-Gm-Message-State: APjAAAUAYTigF/5UpOYQs6B4FvAObwpvi/4Flf3jEjcNzdROp/6V/ZM2 eW5Ff74zY50bN42q4iWlps6AArA2 X-Google-Smtp-Source: APXvYqwpabXbeHTqbvSJaIu+EAJ/zd1P1g/dx9tCgNNgO4WSW2fIzS/U0FJSqjxaQPaKo3LGuYd3Ow== X-Received: by 2002:a1c:63c4:: with SMTP id x187mr132066wmb.4.1565185995209; Wed, 07 Aug 2019 06:53:15 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:645a:5b76:280d:27be]) by smtp.gmail.com with ESMTPSA id o11sm33095wmh.37.2019.08.07.06.53.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 06:53:14 -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: Wed, 7 Aug 2019 15:53:11 +0200 Message-Id: <20190807135312.1730-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190807135312.1730-1-christian.koenig@amd.com> References: <20190807135312.1730-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=cJze+NHLGVWRPTthMI0DgfPkje+BdJ75ftz5VrySl6s=; b=dDSrq3S9bPZbMhEZEpVnoLvGG1ToylF4hJqkXQcCXZI3yEVtstts/1vei/PaKmzU/x 2oN8eMHJiCvkiFfY70j3ff8BVpC0gD2HkN09qwJJyQfcDJ0w+Bi7+OgwgRSDkBgqS7lD b6DYZuf5QUC83ysm3qYltvO9JHEsjGeOPJUTpIDXXp607fq18f/+/q2xxKEVyfUNmJt1 S9PemZVye8bosBndVEhud0qXxbmHKg3hqsEkBzJ289FeLaDkryPviLpxVKh9hjeLa6rK /QxLiwU2PIcFJJJO36NkHOcY1fZT5lho2DWg88E8drq2PwfrNnRKkGuw/8C6ASGHrmD0 cWfg== Subject: [Intel-gfx] [PATCH 3/4] 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 8fcaddffd5d4..90bc6ef03598 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) {