Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1867403lqm; Fri, 3 May 2024 08:39:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfxc9YWFWiDbYVXGMMvKf+JbKBWiFuMekxmK7acn3UXYCRiVQWsFmbzVZg/dWtxz7l8XDiMR44OrdD4WQVEaeamRl8FAfrdOV+aqu2Og== X-Google-Smtp-Source: AGHT+IHg6h3TJqpgfcRn6qVv2YgIP++4LnxwzeSb82Hr8x/5rRn4h6JNDF95Y2FycFPrj+neV1Fp X-Received: by 2002:a05:6870:1614:b0:23e:6d9a:8f45 with SMTP id b20-20020a056870161400b0023e6d9a8f45mr1949783oae.48.1714750786897; Fri, 03 May 2024 08:39:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714750786; cv=pass; d=google.com; s=arc-20160816; b=xrjXtNskOhDnbpLxn5VdRJ+msmQ8uZyDsmjfwYvt5lAC9t6nR5oZVKaj2ou9GMfTXh 8qiPICfd2XnpVp+CTWGAUjH8knH6xOxdbBS/GggC5bRImo6dgtuktsqgTZW+g02c4pVD v/pKZPLeyo0fP9rl0hG5izNEClSMr2xJ/H4WbTqoUpWNA0s7A/DGWpm2OQeGDTGVFgzB aRmZkCa4wUwrA+XNvNrcIs+9Zu/uzgT/N4t510hc2ZlO1QzgQNLOG4PZJKtrcWmFeKcU 0EWVGRGSW/MWuACdnGTyNRKDAZ73/f7ipIHrG02xaeUNO71fCWJ2psNqIqPYhsUqqiGh 0Bvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=SpE7/+FxkwXnbNhXpVFjsvlzjuFu6B6sxg+PjjB7/wo=; fh=KHVmDfie5PNhA8UtDKXMRKaovtl4aVnlV/mSU05FVog=; b=nU8sS8QUDyoMeo9tersS7Xc9DRNvNigj0VacMfyEQMWMvrbpINGatFSgR14jRsuWWk 4P+vmu5YFWBnYjNe9TJCfSf7oQwIqkBsergLBbhkQLF93ir9xKdMjXdJH+eCD2msXoUO Xe5aP2mxls5mYAs/SlLdDGo7ySmc0JYhjrgx9vivDG9nbqhbNVspkE4phqk/yY8kaSPj kmI/6p8nEG5q78r7K09SVwk60D4Z7QkIZQ+eu53+dprZXgZiJF20gIod+J0nTP3Wa5lI Q8mhPp5PsZSzmBZtsQY15WldySVWJYuqB6hF3pGk83A+jb8zAmUQaA8wt5bMg50PT8kC aftQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=AqzuWbvo; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-167841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dt27-20020a05620a479b00b0078bea3b93cbsi1523737qkb.152.2024.05.03.08.39.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 08:39:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=AqzuWbvo; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-167841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 98C851C22638 for ; Fri, 3 May 2024 15:39:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59D5E153598; Fri, 3 May 2024 15:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="AqzuWbvo" Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FA6579E3 for ; Fri, 3 May 2024 15:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714750781; cv=none; b=G3IE6633B0Iao+T6QuxVeqp88STce6owM540ImNjLljXmfaEAzom3Ymw0UpDzpplDQGV59gTDhehym5eXOcTP6MWQB+s8B8qe5tC5HhOVX41pGHnVcwxS3DH/Sj5INf0WB/SzbygawUxyPrFHY2berOUSNwOZbw56084uvRiR1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714750781; c=relaxed/simple; bh=V93HdGLwMZ7/VJVybupXO0YXtn+XaLniqbxkd+Milzs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tUPctTYtXZz7T6NsV7vYhHdBaFt0F5IkhtDwOc60zDZMqJnjCw5xe+DnG2wUt2fwY4XtKtPe9ktZzZSIGE1Gpr+Uz91ZDZgCnXzNlS3mnTTZpdLr7Pch1pAvaTD5jFHmoWt0bdWergZjD0d1Q7FwoXq5UgPha+CxdtYcLQfsQFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=AqzuWbvo; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Received: from fedor-21d0 (unknown [5.228.116.47]) by mail.ispras.ru (Postfix) with ESMTPSA id 8E9B34078539; Fri, 3 May 2024 15:39:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 8E9B34078539 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1714750774; bh=SpE7/+FxkwXnbNhXpVFjsvlzjuFu6B6sxg+PjjB7/wo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AqzuWbvoVk1jb0hT3lDNWLZwHevKst58XvtUZUkHItLv0sc+oP1ofyt6SMkJV26BD eiMqjH8xeR/fgshO93w/XjvOdYQbTG1YK80quk52CJygRmCr1PUmlfgSdAXIO/IUjT WArrQDfCfOQksn9zrLLulo2vRilJko5/3GsTCqtI= Date: Fri, 3 May 2024 18:39:29 +0300 From: Fedor Pchelkin To: Barry Song <21cnbao@gmail.com> Cc: Xiang Chen , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Barry Song , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: Re: [PATCH 2/2] dma-mapping: benchmark: prevent potential kthread hang Message-ID: <20240503-20a2c3986084e60eaac15672-pchelkin@ispras.ru> References: <20240502161827.403338-1-pchelkin@ispras.ru> <20240502161827.403338-3-pchelkin@ispras.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, 03. May 13:44, Barry Song wrote: > On Fri, May 3, 2024 at 4:29 AM Fedor Pchelkin wrote: > [...] > do we still need to do copy_to_user(argp, &map->bparam, sizeof(map->bparam) > after do_map_benchmark(map) fails? > do we also need the below? > diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c > index 02205ab53b7e..28ca165cb62c 100644 > --- a/kernel/dma/map_benchmark.c > +++ b/kernel/dma/map_benchmark.c > @@ -252,6 +252,9 @@ static long map_benchmark_ioctl(struct file *file, > unsigned int cmd, > * dma_mask changed by benchmark > */ > dma_set_mask(map->dev, old_dma_mask); > + > + if (ret) > + return ret; > break; > default: > return -EINVAL; > > Good point, thank you! If benchmark failed, nothing new to be copied back to user, indeed. I'll add this as the third patch of the series and post v2.