From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796134789; b=abXBQNe7xsLP9vCNfmns2XvfigZ3tb6U4dohqtF57OU9N74j+vP8T1D3Ys/hkjX4OjU1 y3/pRMtwdjI10S7lrC0nvUHBajNADxrbffJQMm/YnyoQ4YTFO2GDNUynE5tq2MU5DD+Yf wbuUa9JLff2bV3p3JqClG9/EGAqP4UU38b4DEMJ73ZlJZD4DFaBuCsvggzxQjHhjtfihV +H+zVH+vH/ztMwMOyCmfZm+t30AguPei0M26pui/aZeOVO6Zi1SM3BK8SSRFa8eoKeQEg tqSvaWagRIhQ7zOSgMC6LbJ5Lv8MsbtICyzsqug6LU3oo0ndigP8BQq4SlvI9EpFXpw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796134789; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=5AudID1HafbZv4NkTtlgfxSWerrM64pheBJC5TpIyyw=; b=sdrdEWY0kx2exXFtTtEF73JJaiq2o+4IbH+QwohkjIHltFXgmPuMxR/j/krNOKDB4GM0 dPjeVtK7VUBI5BvNeL4cDw+MSKZ/p5yqDOJmIFs0AVVfMy1kDOpjcMtLVIes7hq17bBMX 4Jbxd5bw4KpmkdAfX41YxQF3JNW7db0m07YtLSsxWqbPvtO/rLoKVuRm1HN1jqGXrpW58 vfoN/dm7h2hks2cZAQyKseYY6Evc/Xt9huOhPVlzU06gLJtcRnw3Bb083UCD2RUMWVCsR SqYXpkgdKq6cRlDS0XCHAMITUqugynn3kvXaiZZ6sD/YKHrOijmzMEyUrCw67WYVT+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=JjTb9alK; arc=none smtp.remote-ip=192.198.163.11 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F7C5606A322; Tue, 1 Dec 2026 14:19:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7F7C5606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=JjTb9alK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796134789; x=1827670789; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5AudID1HafbZv4NkTtlgfxSWerrM64pheBJC5TpIyyw=; b=JjTb9alKumx1xSoHJyqw+SU4P/WkKFps+6FIZPYSYYPlFVgM0+DzrMuk lbpoWs+w+w2k6nZmkI5ZJ/+iMzroAKssvEshuCSuWzpSq9vFZxYGIQzU/ 4tEMeA6lH73Y6pY+B2utiMQWlqbD6jTMRQ/W5elnMrlpW7IKTn2Z8EQWI wPqPaNzWmZGku54cVCTpTh3rsn40JOcTGhdiegcnuK0TjEKXjNT5ihKsT GhTfoEu4kxcBkABvOAVPrcV75a40ImyJxmyNmEIhh0MwheNgZqg31TR6n W1nrYZ72avyVRqgN9/vecX0oCqatMtP9oLbsH9qEXPNji/QkegceMSd6n Q==; X-CSE-ConnectionGUID: vAHDewb1S/ikR7z8Vn7Amw== X-CSE-MsgGUID: C8o+SzUVRoWWQIf7mnRpxw== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="4924935" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4924935" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 06:19:48 -0800 X-CSE-ConnectionGUID: 3xp+c1LJRtKXKMtLmkUblw== X-CSE-MsgGUID: yht/ybGHSH2JSxdX0fMbCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13819022" Received: from jf5300-15a101203tc.jf.intel.com (HELO meta-crater2c.jf.intel.com) ([10.54.113.49]) by fmviesa010.fm.intel.com with ESMTP; 01 Dec 2026 06:19:47 -0800 From: Daniel Byrne To: Ravi Jonnalagadda Cc: Daniel Byrne , Shivank Garg , Andrew Morton , David Hildenbrand , Zi Yan , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Karim Manaouil , Frank van der Linden , Teja Vojjala , Pravin Tamkhane , Kinsey Ho , Wei Xu , Matthew Wilcox , Davidlohr Bueso , Vinod Koul , Bharata B Rao , SeongJae Park , David Rientjes , Xuezheng Chu , Yiannis Nikolakopoulos , Dave Hansen , Johannes Weiner , John Hubbard , Peter Xu , Rik van Riel , Shakeel Butt , Tejun Heo , Fan Ni , Jonathan Cameron , "Aneesh Kumar K.V" , Nathan Lynch , Frank Li , Dan Williams , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Day , dmaengine@vger.kernel.org, Vinicius Costa Gomes , Frank Li , Dave Jiang Subject: Re: [PATCH RFC v6 4/5] drivers/migrate_offload: add DMA batch copy driver (dcbm) Date: Tue, 1 Dec 2026 06:13:31 -0800 Message-ID: <20261201141331.2124291-1-daniel1.byrne@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261128225943.66318-1-ravis.opensrc@gmail.com> References: <20260630-shivank-batch-migrate-offload-v6-0-da95d7e8b8a2@amd.com> <20260630-shivank-batch-migrate-offload-v6-4-da95d7e8b8a2@amd.com> <20261128225943.66318-1-ravis.opensrc@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sat, 28 Nov 2026 22:59:43 +0000, Ravi Jonnalagadda wrote: > Question: would you include this check in v7 to handle unordered > providers (Intel DSA) until device_prep_dma_memcpy_sg() lands, while > keeping a single interrupt per channel list on ordered providers? Hi Ravi, Shivank, I run dcbm on DSA as well, on top of v6, and hit the same three things. Two of them are dmaengine matters that I have series for, so here are some pointers before v7. On the check: DMA_COMPLETION_NO_ORDER is going away in my polled-status series, together with DMA_OUT_OF_ORDER: https://lore.kernel.org/dmaengine/20261019150632.4026424-1-daniel1.byrne@intel.com/ With that series idxd answers the status of every cookie from the descriptor's own completion record. A client can wait for each descriptor of a batch, with an interrupt or by polling. A descriptor without DMA_PREP_INTERRUPT is retired by the query that sees it end, so the work queue no longer fills up. v2 of it is in preparation. It gives a provider a flag that says its status is per descriptor, and a client like dcbm can test that where it would test DMA_COMPLETION_NO_ORDER today. In my copy of dcbm every descriptor has its own completion on every provider, counted down on a pending counter as in your diff. That needs no test at all, at the price of an interrupt per descriptor on an ordered provider. > Question: since dcbm needs to handle provider removal with either > channel model, would you and Vinod prefer a DMAengine core callback > that notifies channel holders before channel unregister / work-queue > disable, or client-side bus notifiers in dcbm as above? I hold the channels too, and I have a third variant for this. It is not posted yet. The core marks a channel that its provider removes under clients as detached. The channel takes no new work, what is outstanding on it ends with an error, and its memory stays until the last client releases it. The client tests dma_chan_detached() where it uses the channel and lets go of it then. That needs no callback into the client under the provider's locks, and the client does not have to know the provider's bus. It goes on top of the two helpers of this series, which is on the list: https://lore.kernel.org/r/20261130195203.1901143-1-daniel1.byrne@intel.com Today idxd warns and then frees the channel under a client that still holds it when the queue is unbound, which is the warning you saw. > Question: when failed channels cannot be replaced after a timeout, > which should dcbm do? On DSA I ended up never terminating from dcbm. terminate_all acts on the whole channel, so on a held, shared channel it ends the other batches too. A device whose completions are overdue takes no new work until everything out on it has landed, and the CPU copies meanwhile. A halted DSA device completes what it held with an error, so that ends with the device's own recovery. > And should MR_NUMA_MISPLACED stay out of offload until failures are > detected sooner I leave NUMA hinting faults out by default, for the reason you give. For device_prep_dma_memcpy_sg() I have an idxd implementation on DSA batch descriptors. It is not posted either, in case it helps the comparison. I think it would be best to merge my dcbm changes with a v7 and with yours instead of posting yet another variant. So that you can see my changes now, I am sending the dcbm part as an RFC on top of v6. It applies on v7.4-rc2 and does not need my dmaengine series. The patches that do need my dmaengine series, the detached channels and the idxd memcpy_sg among it, will follow with those series. Shivank, you can take from the RFC what fits v7, and let me know if you need any changes. Thanks, Daniel