Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp972960lqd; Thu, 25 Apr 2024 02:12:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6ejdnOxUcUE9HFSvL97FBS9MxIut5uHwO+XQUyG6i65ShJZAWox+rxgQ+0DZAu4JFopAmlGJ+2H8oANYrPGBSNMJJFXU45RmMVf75OQ== X-Google-Smtp-Source: AGHT+IHXBrdTGb00t7ejZA/Mr6Ok0mt8Js1q0tJUot9w5ffYbjFu4yNhwuF1dW8QnxivQBNVVSEv X-Received: by 2002:a17:906:d8a:b0:a58:8491:29af with SMTP id m10-20020a1709060d8a00b00a58849129afmr3083562eji.41.1714036321373; Thu, 25 Apr 2024 02:12:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714036321; cv=pass; d=google.com; s=arc-20160816; b=Us0a3XUmzT5FN4lU/0zl9AV2Z04pIK1+kxNPUO1FcNrXT+tHlejgc4s+1JCDCquHOx 3esm736YpQKW6ZpWrc5RT7s+tPOS4yzONMWq6zaPA7V2UJGfmnlTif3xg3ozOGfmsjA1 CJf+woHNkMnXOZbcmV9eAEr5SPw4TEHK438yvn62eN9z49eGlx/wkeBC6wkQnvQzE18C 3TGLIxsqJbY6ucdx2Ge/A//ukHsAyI6dxGXt1rz38OrK72GbBRemJxXjL+lOYQ8s6uzz SIwjQetXjZ2UFPCKPmxUXYiTi2pw3U2P7DcNncHV/2yBfjGEBpIxeyBgqKt7PtOmm6mT F+PA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jkwkH96O+PjBm95Ajv5EV+BgT8uWd5iRW6gQf//FnMs=; fh=iGhOLk+5UpPvigQ635wfcHc6QVwev7kizo620ZtH6eI=; b=jsy96D34m0v+JULUxRglxDmnAsN525RJwv/iLceyeiB5n1ymLQqXfID05fnyITEAjk lYwA8mVPl3t8aD3UuJkR6bqHDbOyIXB2UbjEp060ZZsLQYrNFtN7Ip8jcprlGfRQoVOC I9aDCRCob7qahrdvY05YJt4KJ8Tsc4ohGIsztIOxuQ2Lp5P/rsjSpWhQnnJ07R7mpaf5 erXxWUrfaYW35cLrmS48NkmFGYPpEm/HkW9Hh23lA67WjWOWql10bah/W1L55+MdgKeA T0vVLaAM7S2TQyLxVK4Nv+lJTNuudApeyUPIYcOP8tUsa37E9cDLVZZ9c6qsn1DOzov0 hPZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KwI1RkiD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158241-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158241-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q19-20020a170906389300b00a555bdbdc9csi9531902ejd.890.2024.04.25.02.12.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 02:12:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158241-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KwI1RkiD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158241-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158241-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 67E1A1F25865 for ; Thu, 25 Apr 2024 09:06:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A95A0839E5; Thu, 25 Apr 2024 09:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KwI1RkiD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D17796EB4D; Thu, 25 Apr 2024 09:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714035948; cv=none; b=SAE0gMDzXFBLRSk5H7c1B9qzgcQt4YGLh2BYpmYGATWpJT3NsWdFYl3oWftwlQ6sHpunOdMLQcXyCP/QYBDgV9uVBBlLwD6L+fwfOBAsQ3vKgzlvDot7URjALB1qt8N8fMV503fuYJyiNqnYdlP2gEBbDy4PAO+2bSG0RtADvbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714035948; c=relaxed/simple; bh=CyBxhvSJqvOeVqh/PVEluM40ihBbVCYqOjncj69jKxA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s/RGF5jtAszWjG/MI/7BgLDDMC0YUk6WyMsa4RmHfWyXP9z+xHQFumUzYywLjTj8SkhvKl3O/kTTFwoVWgiTyCtH1YdXtxIYaGjWvOPGdZCJvFKq0cauLZ15Cnf+u2Gl1KfX8d30O2sCI/aly9YtGzBd8I4taUM03rRsE5f4IeU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KwI1RkiD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDA9DC2BD10; Thu, 25 Apr 2024 09:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714035948; bh=CyBxhvSJqvOeVqh/PVEluM40ihBbVCYqOjncj69jKxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KwI1RkiDn7OGmmWnZf7cVb4SHqfIG1KbOnc0Hx8VR8PYobCDWCNuCh2J2RPIw3ljG PSwpaHJ2AX9MKFX0Wk2l7Jh+VEQ73UqtZE01RRzjP47b8luNRzsl4H9Bv2jEd5lUo6 iD6/wO2XiRxD9/NN2AT0+IgZqzjhpG7NwGau5LS+/Q26qEDYaIDDgszfgiZugsVvQB TDNhrD5WF8Ev/uvWKSrADPBEFFPNA5yRcD7fG/MITceyWdK1KpcyN/kfMR1JYnA4ng +maSydeNDM3zZpbr8144/T3aTHcHWrWc8A1JMx8ZR0uBwkU8TseUXxaFdMHGP6ra6j GD1f69o+5A7oQ== Date: Thu, 25 Apr 2024 14:35:44 +0530 From: Vinod Koul To: Jie Hai Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: dmatest: fix timeout caused by kthread_stop Message-ID: References: <20230720114102.51053-1-haijie1@huawei.com> 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=us-ascii Content-Disposition: inline In-Reply-To: On 23-04-24, 11:39, Jie Hai wrote: > Hi, Vinod Koul, > > Stop an ongoing test by > "echo 0 > /sys/module/dmatest/parameters/run". > If the current code is executed inside the while loop > "while (!(kthread_should_stop() || > (params->iterations && > total_tests >= params->iterations)))" > and before the call of "wait_event_freezable_timeout", > the "wait_event_freezable_timeout" will be interrupted > and result in "time out" for the test even if the test > is not completed. > > > > Operations to the problem is as follows, > and the failures are probabilistic: > > modprobe hisi_dma > modprobe dmatest > > echo 0 > /sys/module/dmatest/parameters/iterations > echo "dma0chan0" > /sys/module/dmatest/parameters/channel > echo "dma0chan1" > /sys/module/dmatest/parameters/channel > echo "dma0chan2" > /sys/module/dmatest/parameters/channel > echo 1 > /sys/module/dmatest/parameters/run > echo 0 > /sys/module/dmatest/parameters/run > > dmesg: > > [52575.636992] dmatest: Added 1 threads using dma0chan0 > [52575.637555] dmatest: Added 1 threads using dma0chan1 > [52575.638044] dmatest: Added 1 threads using dma0chan2 > [52581.020355] dmatest: Started 1 threads using dma0chan0 > [52581.020585] dmatest: Started 1 threads using dma0chan1 > [52581.020814] dmatest: Started 1 threads using dma0chan2 > [52587.705782] dmatest: dma0chan0-copy0: result #57691: 'test timed out' > with src_off=0xfe6 dst_off=0x89 len=0x1d9a (0) > [52587.706527] dmatest: dma0chan0-copy0: summary 57691 tests, 1 failures > 51179.98 iops 411323 KB/s (0) > [52587.707028] dmatest: dma0chan1-copy0: result #63178: 'test timed out' > with src_off=0xdf dst_off=0x6ab len=0x389e (0) > [52587.707767] dmatest: dma0chan1-copy0: summary 63178 tests, 1 failures > 62851.60 iops 503835 KB/s (0) > [52587.708376] dmatest: dma0chan2-copy0: result #60527: 'test timed out' > with src_off=0x10e dst_off=0x58 len=0x3ea4 (0) > [52587.708951] dmatest: dma0chan2-copy0: summary 60527 tests, 1 failures > 52403.78 iops 420014 KB/s (0) This is usefel in the commitlog, please add this and update the patchset > > > On 2024/4/18 1:18, Vinod Koul wrote: > > On 20-07-23, 19:41, Jie Hai wrote: > > > The change introduced by commit a7c01fa93aeb ("signal: break > > > out of wait loops on kthread_stop()") causes dmatest aborts > > > any ongoing tests and possible failure on the tests. This patch > > > > Have you see this failure? Any log of that.. > > > > > use wait_event_timeout instead of wait_event_freezable_timeout > > > to avoid interrupting ongoing tests by signal brought by > > > kthread_stop(). > > > > > > Signed-off-by: Jie Hai > > > --- > > > drivers/dma/dmatest.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c > > > index ffe621695e47..c06b8b16645a 100644 > > > --- a/drivers/dma/dmatest.c > > > +++ b/drivers/dma/dmatest.c > > > @@ -827,7 +827,7 @@ static int dmatest_func(void *data) > > > } else { > > > dma_async_issue_pending(chan); > > > - wait_event_freezable_timeout(thread->done_wait, > > > + ret = wait_event_timeout(thread->done_wait, > > > done->done, > > > msecs_to_jiffies(params->timeout)); > > > -- > > > 2.33.0 > > -- ~Vinod