Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp365606ybl; Tue, 28 Jan 2020 04:45:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwW9k+xLzZWbWy1iWtZo4surKhPFaBtkQaC2tzhBzdu7iD2o8mO27R6/BsW5CICq8Mr2w1c X-Received: by 2002:a05:6830:1689:: with SMTP id k9mr16541552otr.311.1580215520131; Tue, 28 Jan 2020 04:45:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580215520; cv=none; d=google.com; s=arc-20160816; b=ZfBpmgc9G0RNGlnDyEcbP/9GiER/vmsUBD7K7/f0Ibvh/HDyGvvGkBFqVTxiCtAD4X cNJM9886EWGQu4EH1KMC+E5oxNNyEJE+MEc/H54NKFasSbbrEZ6xZ8u3ef06IYRsPKhL KGbwGeK5I6vAE+GN4JLZ5kGN7pDUvCkkRzmbJLLo4YhX9pkQmtSz9AJeTcbKlq8b/UFj gXfUHqZrWAOin3cqKIKxu+joxF/tq3MP78wOo4TmdLn/I4sllH9De/we8ohJg/hHvQgx WIMWz7oQj0X5cw2SyolEpV3lJY7bUv9iVhFuXOeD3IocX8JYtVhDyC7kwo2YENlK1hIc VM6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=bgYsZn/KU8dQ4FwR6ZKurRYb9PsYzC/+kuX0s6AUBLg=; b=g3yHPip41dkngO9eNvJDMXWrqZKdZIpBd0PU/e/RaSFG/WcnRU71Wd4aeb+XKt3uy/ vAwxhiQ/yUZrc5AJuPQ+BPWIEGkKm07a9NKBY9FP9ksc7iUHt0A+iL1EB+iJJ8ICnGzr rvGRPL6XS2pzzldHIi6a3RCtOeze2/QZ01wZrHNBn1+v6HHa08htLE6YdIEUabI5eN33 ostOpuxpJ3ngKah18yhD2a9sH2mDvXG+gJLSCcfHY8uzG2Nc1TNANmbohl9vVIlETclm n/8T+1VEptOQn3VhDjEV7HrzjHu/ncSr/7yXXPtSMIewBYU1fD8GyEGI78A7yGzfOFqF M7qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0ZoJyQPS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si8801476otk.179.2020.01.28.04.45.07; Tue, 28 Jan 2020 04:45:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0ZoJyQPS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbgA1MoK (ORCPT + 99 others); Tue, 28 Jan 2020 07:44:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:51594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725852AbgA1MoK (ORCPT ); Tue, 28 Jan 2020 07:44:10 -0500 Received: from localhost (unknown [223.226.101.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27690206A2; Tue, 28 Jan 2020 12:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580215450; bh=uKTAUZDjKUwxebo4v8hWYH0ksqT6ZERmpWj9YNS4ylY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0ZoJyQPS/SeO7O+nmQsuEE54zWfhEDBWIEBSYmbImypPSxRhjK5iDMoBau/mWaEU3 UqvF53mj3rEDZf8IZJhVt951W4BJDXnyuw3VJD7eHj+USLlgJaTL6A5C3Sj4/wq4HQ GXqNkctDThbtk8WPPQzEVHev/kTQ4bsc6jY/dQz0= Date: Tue, 28 Jan 2020 18:14:03 +0530 From: Vinod Koul To: Vignesh Raghavendra Cc: Peter Ujfalusi , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com, grygorii.strashko@ti.com Subject: Re: [PATCH for-next 1/4] dmaengine: ti: k3-udma: Use ktime/usleep_range based TX completion check Message-ID: <20200128124403.GV2841@vkoul-mobl> References: <20200127132111.20464-1-peter.ujfalusi@ti.com> <20200127132111.20464-2-peter.ujfalusi@ti.com> <20200128114820.GS2841@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28-01-20, 17:35, Vignesh Raghavendra wrote: > >> + /* Transfer is incomplete, store current residue and time stamp */ > >> if (peer_bcnt < bcnt) { > >> uc->tx_drain.residue = bcnt - peer_bcnt; > >> - uc->tx_drain.jiffie = jiffies; > >> + uc->tx_drain.tstamp = ktime_get(); > > > > Any reason why ktime_get() is better than jiffies..? > > Resolution of jiffies is 4ms. ktime_t is has better resolution (upto ns > scale). With jiffies, I observed that code was either always polling DMA > progress counters (which affects HW data transfer speed) or sleeping too > long, both causing performance loss. Switching to ktime_t provides > better prediction of how long transfer takes to complete. Thanks for explanation, i think it is good info to add in changelog. -- ~Vinod