linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sriram R <srirrama@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFCv2 2/2] mac80211: Add support for per-rate rx statistics
Date: Wed, 29 Aug 2018 19:37:57 +0530	[thread overview]
Message-ID: <a9d2eb34e3f814523d354252fc639c5b@codeaurora.org> (raw)
In-Reply-To: <1535446818.5895.15.camel@sipsolutions.net>

On 2018-08-28 14:30, Johannes Berg wrote:
> Hi,
> 
> Sorry for the late reply, my work hours are limited right now.
> 
>> I wanted to give a try with rhashtable and get your thoughts, since it
>> gave below flexibility to original patch,
>> 1. avoids creating static memory when userspace starts accumulating
>> stats. 36 rate entries were used in original patch based on 10 (MCS
>> count) * 3 (entries per mcs)+ 6 escape entries, which would also
>> increase with HE supported now.
> 
> True, but rhashtable also has very significant overhead. I suspect it's
> around the same order of magnitude as the allocation you need to keep
> all the 36 entries?
> 
> struct rhashtable is probably already ~120 bytes on 64-bit systems 
> (very
> rough counting), and a single bucket table is >64, so you already have
> close to 200 bytes for just the basic structures, without *any* 
> entries.
> And a significant amount of code too.
> 
> 36 rate entries could probably be kept - I don't think you really need
> to go more than that since you're not going to switch HT/VHT/HE all the
> time, so that's only about 360 bytes total. You haven't gained much, 
> but
> made it much more complex, doing much more allocations (create
> new/destroy old entries) etc.
> 
> I don't really see much value in that.
> 
Okay Johannes. I'll revive this patch based on your approach
and submit for review.

Thanks,
Sriram.R
>> 2. avoids restricting to only 3 entries per MCS in the table. Using
>> hashtable gave flexibility to add/read the table dynamically based on
>> encoded rate key.
> 
> Yes but if you don't limit, you end up with run-away memory consumption
> again.
> 
>> Yes you're right ,it might grow but, as per this patch when Packet 
>> count
>> is greater
>> than 65000 in an exntry or when the number of rate table/hashtable
>> entries exceed a count of MAX_RATE_TABLE_ELEMS (10 was used in this
>> patch), the complete table is dumped to userspace and new stats starts
>> getting collected in a new table after we flush the old one.
>> Hence with this approach also the memory consumption is limited 
>> similar
>> to the original patch.
> 
> Right, so you limit to 10 entries, which is a total of
> 
>  ~120 + ~72 + 10 x (10 /* data */ + 3*8) = 524
> 
> in 12 different allocations. I don't think that's going to be much
> better, and you seemed to think that the 10 would be commonly hit
> (otherwise having a relatively small limit of 36 shouldn't be an issue)
> 
> So - I don't really see any advantage here, do you?
> 
> johannes

      reply	other threads:[~2018-08-29 18:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28 13:34 [RFCv2 0/2] nl80211/mac80211 Add support for per-rate rx statistics Sriram R
2018-05-28 13:34 ` [RFCv2 1/2] nl80211: support per-rate/per-station statistics Sriram R
2018-06-15 12:19   ` Johannes Berg
2018-08-12  2:07     ` Sriram R
2018-05-28 13:34 ` [RFCv2 2/2] mac80211: Add support for per-rate rx statistics Sriram R
2018-06-15 12:25   ` Johannes Berg
2018-08-12  2:44     ` Sriram R
2018-08-28  9:00       ` Johannes Berg
2018-08-29 14:07         ` Sriram R [this message]

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=a9d2eb34e3f814523d354252fc639c5b@codeaurora.org \
    --to=srirrama@codeaurora.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@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 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).