From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753787AbcE3Dg1 (ORCPT ); Sun, 29 May 2016 23:36:27 -0400 Received: from mga02.intel.com ([134.134.136.20]:57554 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753399AbcE3DgZ (ORCPT ); Sun, 29 May 2016 23:36:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,387,1459839600"; d="scan'208";a="987181100" Date: Mon, 30 May 2016 09:12:53 +0530 From: Vinod Koul To: Kuninori Morimoto Cc: Geert Uytterhoeven , Laurent Pinchart , dmaengine@vger.kernel.org, sakato , linux-kernel@vger.kernel.org, OSD2 ML Subject: Re: [PATCH v2] dma: rcar-dmac: use list_add() on rcar_dmac_desc_put() Message-ID: <20160530034252.GF16910@localhost> References: <8760w7xq3n.wl%kuninori.morimoto.gx@renesas.com> <874mbrxnft.wl%kuninori.morimoto.gx@renesas.com> <1645988.6VIRltF7C5@avalon> <877fecbcxh.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877fecbcxh.wl%kuninori.morimoto.gx@renesas.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 30, 2016 at 12:41:48AM +0000, Kuninori Morimoto wrote: > > From: Kuninori Morimoto > > For each descriptor, in addition to the memory used by the descriptors > structure itself, the driver allocates a list of chunks as well as a > buffer for hardware descriptors. Descriptors themselves are preallocated, > and allocation of the chunks and buffer is performed the first time the > descriptor is used. The memory isn't freed when the transfer is completed, > as the chunks and buffer will be needed again when the descriptor is > reused internally, so the driver keeps the memory around. > > If only a few descriptors are used concurrently, the current > list_add_tail() implementation will result in all preallocated descriptors > being used before going back to the first one, and will thus allocate > chunks and a buffer for all preallocated descriptors. Using list_add() > will put the complete descriptor at the head of the list of available > descriptors, so the next transfer will be more likely to reuse a > descriptor that already has associated memory instead of one that has > never been used before. Applied after fixing subsystem name -- ~Vinod