title: How does "scatterlist" works in linux?
body: <p>As we know scatter list gathers the memory scattered physically across the memory, but virtually contiguous though. When communicating with DMA it provides an abstracted view of memory to DMA as of this is memory contiguous physically.</p>
  
  <p>How does <code>scatterlist</code> handle this? Is it a kind of linked list maintained within the <code>scatterlist</code>?</p>
  
  <p>For example if have 4000 bytes of data to be transferred using DMA ,as data is physically contiguous how scatter list makes it contiguous ? will scatterlist implementation allocate 4000 bytes of data using <code>Kmalloc</code> to make sure that it gets a physically contiguous memory? or will it
  create a linked list?</p>
  
  <p>Note: here my query is not about the SG table,but about an individual scatterlist</p>
  
  <p>Let us say we want to hold the data of 4000 bytes of physically discontiguous memory</p>
  
  <pre><code>struct scatterlist sg,
  sg_init_one(&amp;sg,data,4000)
  </code></pre>
  
  <p>Now how does this sg addresses the issue?</p>