From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3829C33C1AD for ; Mon, 9 Mar 2026 18:04:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773079489; cv=none; b=CdasKCClUJz5/ckl0IfgbLYafjNYmojoPixpBanl9yh1t4qLuK0ZF3YtbDNEBy7b6rXnbPulzVUaiPrnCWW/icMfOVeZuUjMIBp6MbHg/jH7Mo1f4G6jXFsdctXzFyfy6FHIHM2f+GiYyTgxp0rsOqO+3jXZfN8PJujk44zM32s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773079489; c=relaxed/simple; bh=zEiC5tsHkaoM0EvIqarL7aCDcP6UXa2jSNk7yXWGRQk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fCwUSRvFeAn4GtfG2K2Kbd1XORxw5vyFYvorzeywZxrPSY4sIb3T7m+vuvkb6jlAxJv4j3q2++q7AOmLoeIh07GdpUk8clbYTWgf1xlsLiOVn6/lP0qU5irOw9jI1TmpqufbcJMCA4x1wpM7jnnLZA97ff9PzpEiGGwrEmeyQA4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=Nzp293QR; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="Nzp293QR" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-8cd71fb9f06so195658585a.2 for ; Mon, 09 Mar 2026 11:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1773079487; x=1773684287; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EnsZoTHqPlFZnEEzFa42610iNi8wbEfxZ1jSz4BbHMo=; b=Nzp293QRB1QWu/w8acFuqHqLXX+gsb2Of5sxRbI9YCyQDwg26extSvHH7elaIwNQrs CLLm0+w1MSiF1bIk8vgw/23yAhqLnzFn1zGpDGcicthAk5CaMB15Myg6UvZRb/6Ew0MC gm1Lsr7ZXYErSxN5CFK8XsnNrAcEy8VB8glB2IFYoa42HV2Lk4DlcMTwpGMRsVrKU5jK osbVDu0qa2c9zoTrVcM26gtNNNBxNj3CCkouGivYi8tIKpBMB37hdm8KfFjQHJtL4s7z JqUEkROwXcr1sIJBGykgjEzY/IGAO45ZpwqwjuzOBDp4z+txls0ZpWJqwWX3SOG56yCh i4yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773079487; x=1773684287; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EnsZoTHqPlFZnEEzFa42610iNi8wbEfxZ1jSz4BbHMo=; b=CZTjPm5nyqxjHj46Jd0YgSAmPSmkhpF3Cvv3mx/MXGqC1DN9Ntd/k3cWroN5rssGS3 aCiay6B/tRzuR/di40xp3S/iLeNdClsz661TPeC2UPhoZw01COL1K986UQv+F5O3o4zx N5iBGgjP9BdHaAH7utRDl+NM0YMOWF8W3X/36bb7547qE8FaME1gJ8c24rG41FB/vnwb WtrTuVjPSwdJX4r8a9+EJHUlHFTvF214euxzrCr6hormpcZOcDTzsPxQV3F0jn+/CBzu JUz/PtGRWZGV08Mjk+Tu4PhaUeXIXCuuLVOKPnSbiAG2bmF1iLI3keS14tsCuzGa6IFQ Q0Mg== X-Forwarded-Encrypted: i=1; AJvYcCWeIsqAi9tjJqORu1z6eB8jaARde0hk/cZFam/7vl/0Cd1vGKyenVxguu19f/BLy7ACe9F9KXGIcvOXADU=@vger.kernel.org X-Gm-Message-State: AOJu0YxOECuu4bmTKCNLwkncv14PtmVXA7MCUOd6sm669Xc41wYue8ky U9PnPf1q9Rpna9GO1ES23EEUfBlSYD31cVjfQK3yO8BHkQJZKKPeHM6SAGvJeY0pZ5w= X-Gm-Gg: ATEYQzw1cKEZV2oBZREonhub59pDjKRvcSZabHiKYDxf0YOY5GjtnbkXhfslPbiDbVX kz2QneyLiiB4rs54Xp0Yj7DSTSdnZfO9Mbp1U/utJxpRy23tt/rbNWe34LDB/33C6qjHWdq+HLV YEd0Tu7pySvNKCFXiUVkK7zV+0E+qyJ7MaefZ0ejpMJ05Cqf86Q20bAJbg3XUVdJ9gkZqFM589I e8E3uiLLcMSU6Ju59SfjAJdJNVTlatzUbZ2zklOKf/Y+fVif6ym3xfPHeuuhpFUVt+6G215BJtM XPlOgnwvOkm2wTFkl2nbGIa88Zi4xtkPwSZXSyVv3LURe11ps9c4EiyrdNnFyP/KNT4cTcT2We/ OIZhjdUgGL9Z7cDgG064xQg1CGvhrSzS4WL+Dcid/zYHQ3ZrqVbrhEP+BhqrbU/6kSz81AlG9Zj y4uzyZUONk8YfjBdQ1+fhWbTE9e3MhD/c7hpNxQCC1en9Xheh9Q4WXatk2puSrbluoZbGYGGesT VWISnVjKw== X-Received: by 2002:a05:620a:3911:b0:8c0:af6c:fdfa with SMTP id af79cd13be357-8cd6d322a40mr1382538085a.3.1773079486979; Mon, 09 Mar 2026 11:04:46 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cd81aa2eefsm376234385a.42.2026.03.09.11.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 11:04:46 -0700 (PDT) Date: Mon, 9 Mar 2026 14:04:44 -0400 From: Gregory Price To: Shivank Garg Cc: akpm@linux-foundation.org, david@kernel.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@kernel.org, willy@infradead.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, ziy@nvidia.com, matthew.brost@intel.com, joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com, ying.huang@linux.alibaba.com, apopple@nvidia.com, dave@stgolabs.net, Jonathan.Cameron@huawei.com, rkodsara@amd.com, vkoul@kernel.org, bharata@amd.com, sj@kernel.org, weixugc@google.com, dan.j.williams@intel.com, rientjes@google.com, xuezhengchu@huawei.com, yiannis@zptcorp.com, dave.hansen@intel.com, hannes@cmpxchg.org, jhubbard@nvidia.com, peterx@redhat.com, riel@surriel.com, shakeel.butt@linux.dev, stalexan@redhat.com, tj@kernel.org, nifan.cxl@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v4 5/6] drivers/migrate_offload: add DMA batch copy driver (dcbm) Message-ID: References: <20260309120725.308854-3-shivankg@amd.com> <20260309120725.308854-14-shivankg@amd.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: <20260309120725.308854-14-shivankg@amd.com> On Mon, Mar 09, 2026 at 12:07:31PM +0000, Shivank Garg wrote: > diff --git a/drivers/migrate_offload/Kconfig b/drivers/migrate_offload/Kconfig > new file mode 100644 > index 000000000000..0bbaedbae4ad > --- /dev/null > +++ b/drivers/migrate_offload/Kconfig > @@ -0,0 +1,8 @@ > +config DCBM_DMA > + bool "DMA Core Batch Migrator" Should this be tri-state or is built-in the only valid state? > +static int setup_sg_tables(struct dma_work *work, struct list_head **src_pos, > + struct list_head **dst_pos, int nr) > +{ ... snip .. > + dev = dmaengine_get_dma_device(work->chan); > + if (!dev) { > + ret = -ENODEV; > + goto err_free_dst_table; > + } > + ret = dma_map_sgtable(dev, work->src_sgt, DMA_TO_DEVICE, > + DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_NO_KERNEL_MAPPING); > + if (ret) > + goto err_free_dst_table; > + ret = dma_map_sgtable(dev, work->dst_sgt, DMA_FROM_DEVICE, > + DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_NO_KERNEL_MAPPING); > + if (ret) > + goto err_unmap_src; > + > + if (work->src_sgt->nents != work->dst_sgt->nents) { > + ret = -EINVAL; > + goto err_unmap_dst; > + } Fairly new to dma space, but I thought the dma stuff could merge pages on iommu systems. Wouldn't this check hit fairly often? ~Gregory