Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp230904rwl; Thu, 23 Mar 2023 15:24:58 -0700 (PDT) X-Google-Smtp-Source: AKy350bbYsJBhRp17rTl9ZPOCzbqasymZlKem6yqYmkZAaao5MSO2g7LU3urM9ZqzNLoc/J+BVE+ X-Received: by 2002:a05:6402:156:b0:4bc:7eb9:4b2c with SMTP id s22-20020a056402015600b004bc7eb94b2cmr802795edu.35.1679610298745; Thu, 23 Mar 2023 15:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679610298; cv=none; d=google.com; s=arc-20160816; b=w3foeTPY35iECpjACRayLMfCeVQmYjhdPIuGRNQSu9bKSMThZH3V/Kp0eUB+R0PHzf NGXCcCRqsId+j8SakGUxyt0e0sdnVm5G2rwB8TezndNOm6FYi0oMp+9Dy/dbHf50t702 nHrwtrUIJb0sz7Y2Fsmou5CY3jYmozHkCuMNE8q2aMqlPx61AGIB2/jqpeb0CJvVpOgi pzlU4abVqo4hRKHLFxScG1A9w8jOcTQtqsZRRb+8VDPRtlsXVpxrdKi13S4VHsSkdCoh iVJdlLel7zc6lI1ZpF7vmJY0CLKBLQV7jP/o5xWLUQNEf1XIk1oMTcvCapWQcs3WIEJw 4kpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=FPqirBVbYtSbVTCuC7k4mSwou0o3U1BuP+9mvzPcF2o=; b=UG0D54x2TlPVIIIVzYWgWOXh5I1HlfNwPnuD+OuLK3vMJ//SCR7jE3fR/g2qZN8bPC 0ECkqaFvaes47l7Xa5xy57KXPjwX/XGzQFNmPF4z1acPelOGOSZfn6rmwo+IH8dENhgx rtqwL7AAQerkjGsWVhuWStViSsMqoieDNnXcsQSRK0jRQ22qD2h7Y3hvAj1SUG+hsrtv 3P5C6vmJPz4Bgm0a19JWrMVdVqFm+6CKWTw4kC/wNBiZTbHimevZOAOh2uEtPEiRhAJY Q8E5QH+SNnSsduR/ueKJ1RHlyOMOL1Y7ZSmj8acCGJaaR6eiS6KqIi6sx1KTilTbAMG/ vUew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Uf3/eNdZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020aa7cf8a000000b0050220a6041asi152213edx.311.2023.03.23.15.24.34; Thu, 23 Mar 2023 15:24:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="Uf3/eNdZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231317AbjCWWTW (ORCPT + 99 others); Thu, 23 Mar 2023 18:19:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbjCWWTU (ORCPT ); Thu, 23 Mar 2023 18:19:20 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA311E5EF for ; Thu, 23 Mar 2023 15:19:19 -0700 (PDT) Received: from [192.168.2.179] (109-252-120-116.nat.spd-mgts.ru [109.252.120.116]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 677B86603101; Thu, 23 Mar 2023 22:19:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1679609958; bh=13qVgcP+l402P7/bUsTCXjHnBiBLeTZcTgT6kSPNWb0=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=Uf3/eNdZhGOsKSWW+wFFZJ6SCAGucTcsjedMz7X0kGqPhoroFdQpqSfN58NCXdNHM XHuuJLFzA63hNuh/hylex9xAK/fp4qMWcqJPuFnE3c0pYA0546tyH987EBn50LW+6b LP7MKjL7rJgPKL+wf3lBrrvoqB0QdKoKbbFoD7XJrL+SqdLt8ikeV7eXzoGyyFBw51 OUnvBc0xOovAoDYoSp8+OHZDHtatjo9Lgt9HdSNYbRB2vjzH/G/5P9LbmeCKHLH2VY xqHRzJXXkRNTMa3lQ88ScL1Tk0ATT5lmktMYO6hR21pFMPFgtKw52ZDuonSmVQFhuK 6sVMtc+lR6Stw== Message-ID: Date: Fri, 24 Mar 2023 01:19:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3 2/2] drm/virtio: Support sync objects Content-Language: en-US From: Dmitry Osipenko To: Rob Clark Cc: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= , Pierre-Eric Pelloux-Prayer , Emil Velikov , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, virtualization@lists.linux-foundation.org References: <20230323190340.950875-1-dmitry.osipenko@collabora.com> <20230323190340.950875-3-dmitry.osipenko@collabora.com> <889ce0e7-f61a-ed0a-35d5-1a9290521d49@collabora.com> In-Reply-To: <889ce0e7-f61a-ed0a-35d5-1a9290521d49@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/24/23 00:51, Dmitry Osipenko wrote: > On 3/24/23 00:18, Rob Clark wrote: > ... >>> +static int >>> +virtio_gpu_parse_deps(struct virtio_gpu_submit *submit) >>> +{ >>> + struct drm_virtgpu_execbuffer *exbuf = submit->exbuf; >>> + struct drm_virtgpu_execbuffer_syncobj syncobj_desc; >>> + size_t syncobj_stride = exbuf->syncobj_stride; >>> + struct drm_syncobj **syncobjs; >>> + int ret = 0, i; >>> + >>> + if (!submit->num_in_syncobjs) >>> + return 0; >>> + >>> + syncobjs = kcalloc(submit->num_in_syncobjs, sizeof(*syncobjs), >>> + GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY); >> I *think*, assuming I'm reading where this is called correctly (kinda >> wish git would show more lines of context by default) that these don't >> need to be NOWARN|NORETRY (same for post_deps). I guess you inherited >> this from drm/msm, where I appear to have forgotten to update the >> syncobj path in commit f0de40a131d9 ("drm/msm: Reorder lock vs submit >> alloc"). I don't see anything obvious that would require NORETRY, but >> lockdep should be able to tell you otherwise if needed. > > The NORETRY should prevent waking up OOM killer, it shouldn't help with > lockdep. Nothing prevents userspace from giving a big number of > num_in_syncobjs. But perhaps indeed not very practical to care about > this case, given that other similar memalloc paces of execbuffer_ioctl() > aren't using NORETRY. Alright, let's drop it in v4. > Although no, there is only a kvmalloc_array() in the code and vmalloc uses NOWARN and NORETRY flags implicitly. May be better switch to use kvmalloc everywhere, for consistency. Technically, vmalloc shouldn't ever be needed for a submit code path and kmalloc should be enough. On the other hand, vmalloc acts like kmalloc until there is no enough contig memory. -- Best regards, Dmitry