All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jambunathan K <jambunathan@netxen.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, sanjeev@netxen.com
Subject: Re: xen_create_contiguous_region  - Regarding
Date: Tue, 10 Apr 2007 11:55:57 +0530	[thread overview]
Message-ID: <461B2DF5.8050902@netxen.com> (raw)
In-Reply-To: <C23FFD0D.58DA%Keir.Fraser@cl.cam.ac.uk>

Keir

>>> Given that our driver supports 35-bit mask, the fact that
>>> xen_create_contiguous_region constrains "machine contiguous" allocations
>>> to less than dma_bits seems very limiting.
>>>
>>> What would be the recommended way to get machine contiguous pages within
>>>  say (1<<35)?
>> 
>> The address width is a parameter to xen_create_contiguous_region().
>> 

Let me explain what I meant.

xen_create_contiguous_region (as in Xen-3.0.4) can be instructed to make
2 kinds of allocations - from either MEMZONE_DOM or MEMZONE_DMADOM. Two
zones are delineated by max_dma_mfn as dictated by dma_size.

A "MEMF_dma" request to __alloc_domheap_pages is assured to be satisfied
from the MEMZONE_DMADOM.

The role of address_bits apparently stops at discreetly choosing between
one of the above 2 zones.

I am of the understanding that xen_create_contiguous_region() *cannot*
assure allocations say within (1<<35) (and desirably from outside of
MEMZONE_DMADOM)


In memory_exchange,

    if ( (exch.out.address_bits != 0) &&
         (exch.out.address_bits <
          (get_order_from_pages(max_page) + PAGE_SHIFT)) )
    {
        if ( exch.out.address_bits < dma_bitsize )
        {
            rc = -ENOMEM;
            goto fail_early;
        }
        memflags = MEMF_dma;
    }


the above code snippet requires that address_bits be atleast dma_bitsize
in which case it flags the alloc request as from MEMZONE_DMADOM. This
seems a bit counter intuitive to me. Is not address_bits a mandated
"spec" on the output extent.

In essence I have the following requests wrt xen_create_contiguous_region():

1) Export it.
2) Have it honor address_bits spec.

I can try my hand at submitting a patch if I have an in principle nod.

Thanks,
Jambunathan K.

  reply	other threads:[~2007-04-10  6:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-06 10:46 xen_create_contiguous_region - Regarding Jambunathan K
2007-04-06 11:07 ` Keir Fraser
2007-04-06 12:54   ` Jambunathan K
2007-04-09 13:17     ` Jambunathan K
2007-04-09 13:24       ` Keir Fraser
2007-04-10  6:25         ` Jambunathan K [this message]
2007-04-10  9:17           ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=461B2DF5.8050902@netxen.com \
    --to=jambunathan@netxen.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=sanjeev@netxen.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.