From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrea Merello <andrea.merello@gmail.com>
Cc: John Linville <linville@tuxdriver.com>,
Linux Wireless List <linux-wireless@vger.kernel.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
Bernhard Schiffner <bernhard@schiffner-limbach.de>,
Huqiu Liu <liuhq11@mails.tsinghua.edu.cn>
Subject: Re: [PATCH 3/7] rtl818x: check for pci_map_single() success when initializing RX ring
Date: Tue, 18 Feb 2014 22:22:39 +0300 [thread overview]
Message-ID: <20140218192239.GP26776@mwanda> (raw)
In-Reply-To: <CAN8YU5P1-7TxvDFifEWPhGh3MbLP_DMJWS9Sbzte+TDcuELKLg@mail.gmail.com>
On Tue, Feb 18, 2014 at 08:06:51PM +0100, Andrea Merello wrote:
> Thank for pointing out this. Yes, I probably exaggerated trying hard
> to allocate memory.
>
> If your point is about if pci_map_single may or not ever fail in real
> life (that is was I thought you meant in your first mail), then I
> think that it's worth to keep the check anyway (I think it could
> happen).
Please keep the check.
>
> If your point is that it can be not so much useful to try and retry
> hard the allocation (I must admit I'm not even sure that after freeing
> the skb the kernel will not likely re-allocate the same one at the
> next try), then I will keep the error check, but I can remove code
> that retries allocation (failing at the first error as you suggested).
Yes. Please remove the retry code unless there is some real life
justification for it where you have seen partial allocations before.
>
> BTW consider that the allocation is done in ieee80211 start callback,
> that is called every time the interface is brought down/up, and not
> once at the begining.
>
You are right. I didn't realize that.
> On one hand I cared avoiding wasting memory when the interface is not up.
> On the other hand I had thought also to move memory allocation in
> initialization, exactly to increase success probability as you pointed
> out..
>
> I chosen the first option because after the interface is brought up,
> the RX ant TX processes will start to perform a lot of other skb
> allocations and dma maps.
> If we assume, as you pointed out, they will likely ALL fail or
> succeeds, not just few of them, then probably even if we allocated
> some memory at init time, we have gained not advantage.
>
> Do you agree ?
Yes.
regards,
dan carpenter
next prev parent reply other threads:[~2014-02-18 19:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 1:10 [PATCH 0/7] rtl818x: second bunch of fixes ported from rtl8187se merge process Andrea Merello
2014-02-18 1:10 ` [PATCH 1/7] rtl818x: Explicitly enable contetion window Andrea Merello
2014-02-18 1:10 ` [PATCH 2/7] rtl818x: pci_iomap() should pair with pci_iounmap() Andrea Merello
2014-02-18 1:10 ` [PATCH 3/7] rtl818x: check for pci_map_single() success when initializing RX ring Andrea Merello
2014-02-18 9:31 ` Dan Carpenter
2014-02-18 18:05 ` Andrea Merello
2014-02-18 18:27 ` Dan Carpenter
2014-02-18 19:06 ` Andrea Merello
2014-02-18 19:22 ` Dan Carpenter [this message]
2014-02-18 20:17 ` Andrea Merello
2014-02-18 20:36 ` Dan Carpenter
2014-02-18 22:10 ` Andrea Merello
2014-02-22 16:57 ` [PATCH 3/7 V2] " Andrea Merello
2014-02-18 1:10 ` [PATCH 4/7] rtl818x: make dev_alloc_skb() null pointer check to really work Andrea Merello
2014-02-18 1:10 ` [PATCH 5/7] rtl818x: add comments to explain few not obvious HW configs Andrea Merello
2014-02-18 1:10 ` [PATCH 6/7] rtl818x: Make sure the TX descriptor "valid" flag is written by last Andrea Merello
2014-02-18 1:10 ` [PATCH 7/7] rtl818x: make sure TX descriptor writes are done before kicking DMA Andrea Merello
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=20140218192239.GP26776@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Larry.Finger@lwfinger.net \
--cc=andrea.merello@gmail.com \
--cc=bernhard@schiffner-limbach.de \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=liuhq11@mails.tsinghua.edu.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).