From: "nickcheng" <nick.cheng@areca.com.tw>
To: 'Daniel Drake' <dsd@gentoo.org>
Cc: 'James Bottomley' <James.Bottomley@HansenPartnership.com>,
linux-scsi@vger.kernel.org, 'erich' <erich@areca.com.tw>
Subject: RE: Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix message allocation
Date: Mon, 25 Feb 2008 18:47:49 +0800 [thread overview]
Message-ID: <000401c8779b$de5619c0$8800a8c0@Nick> (raw)
In-Reply-To: <47C29506.4000609@gentoo.org>
Sorry, maybe I did not ask distinctly enough.
I mean if I would like to allocate a memory space from ZONE_DMA for atomic
context, why can I not use kmalloc(1032, GFP_ATOMIC|GFP_DMA)?
In case of lack of GFP_DMA, kmalloc would grab the memory from ZONE_HIGH or
ZONE_HIGHMEM, isn't it?(I read it from the textbook of Linux Kernel
Development by Robert Love)
Or the basic is that you don't think it is necessary to allocate a memory
space from DMA area?
Please give me some comments.
Thank you very much, :-)
-----Original Message-----
From: Daniel Drake [mailto:dsd@gentoo.org]
Sent: Monday, February 25, 2008 6:15 PM
To: nick.cheng@areca.com.tw
Cc: 'James Bottomley'; linux-scsi@vger.kernel.org
Subject: Re: Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix message
allocation
nickcheng wrote:
> Hi,
> I definitely agree it is in atomic context but why is the memory not for
> DMA?
> Would you please show me why?
It would probably be easier if you could explain where you believe the
memory IS used for DMA :)
Anyway, looking at ARCMSR_MESSAGE_READ_RQBUFFER
current code does this:
ver_addr = kmalloc(1032, GFP_ATOMIC);
Here are the cases when that buffer is used:
checking for successful malloc: not DMA
if (!ver_addr) {
copying the address: not DMA
ptmpQbuffer = ver_addr;
memcpying 1 byte into the buffer: not DMA
memcpy(ptmpQbuffer, pQbuffer, 1);
incrementing address: not DMA
ptmpQbuffer++;
memcpying from the buffer: not DMA
memcpy(pcmdmessagefld->messagedatabuffer, ver_addr,
allxfer_len);
freeing the buffer: not DMA
kfree(ver_addr);
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-02-25 10:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <001401c87753$3edf4670$8800a8c0@Nick>
2008-02-25 10:14 ` Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix message allocation Daniel Drake
2008-02-25 10:47 ` nickcheng [this message]
2008-02-25 14:38 ` James Bottomley
2008-02-26 4:29 ` Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix messageallocation nickcheng
2008-02-26 16:14 ` James Bottomley
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='000401c8779b$de5619c0$8800a8c0@Nick' \
--to=nick.cheng@areca.com.tw \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dsd@gentoo.org \
--cc=erich@areca.com.tw \
--cc=linux-scsi@vger.kernel.org \
/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.