Lets make wifi fast again!
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>,
	make-wifi-fast@lists.bufferbloat.net,
	linux-wireless@vger.kernel.org
Subject: Re: [Make-wifi-fast] [PATCH 1/2] mac80211: Add TXQ scheduling API
Date: Tue, 17 Oct 2017 08:39:40 +0200	[thread overview]
Message-ID: <1508222380.10607.55.camel@sipsolutions.net> (raw)
In-Reply-To: <20171016160902.8970-1-toke@toke.dk> (sfid-20171016_180931_557642_CDEF1515)


>  	/* protects shared structure data */
>  	spinlock_t data_lock;
> -	/* protects: ar->txqs, artxq->list */
> -	spinlock_t txqs_lock;
>  
> -	struct list_head txqs;

I don't see you removing the artxq->list member, but surely it can't be
used any more now, without a list?

[snip] that's about all I can comment on ath*k :)

> +/**
> + * ieee80211_schedule_txq - add txq to scheduling loop
> + *
> + * @hw: pointer as obtained from ieee80211_alloc_hw()
> + * @txq: pointer obtained from station or virtual interface

or more likely next_txq()? :)

> + * Returns true if the txq was actually added to the scheduling,
> + * false otherwise.

Perhaps use %true/%false.

>  	if (sta->sta.txq[0]) {
> +		bool wake = false;

please add a blank line after this new line

>  		for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
>  			if (!txq_has_queue(sta->sta.txq[i]))
>  				continue;
>  
> -			drv_wake_tx_queue(local, to_txq_info(sta->sta.txq[i]));
> +			wake = wake || ieee80211_schedule_txq(&local->hw, sta->sta.txq[i]);
>  		}
> +		if (wake)
> +			drv_wake_tx_queue(local);
>  	}

Are you sure you want to skip the call to ieee80211_schedule_txq() if
wake is true? I think you don't, but boolean short-circuit evaluation
would lead to that, afaict?

So it better be written as

  if (ieee80211_schedule_txq(...))
    wake = true;

No need to even check wake anyway, since it can only ever go from false
to true.

(Also, that line is getting a bit long)

>  	skb_queue_head_init(&pending);
> diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
> index 3d9ac17af407..531c0e7f2358 100644
> --- a/net/mac80211/trace.h
> +++ b/net/mac80211/trace.h
> @@ -2550,33 +2550,20 @@ TRACE_EVENT(drv_tdls_recv_channel_switch,
>  );
>  
>  TRACE_EVENT(drv_wake_tx_queue,
> -	TP_PROTO(struct ieee80211_local *local,
> -		 struct ieee80211_sub_if_data *sdata,
> -		 struct txq_info *txq),
> +	TP_PROTO(struct ieee80211_local *local),

You should just replace all of this with

DEFINE_EVENT(local_only_evt, drv_wake_tx_queue,
        TP_PROTO(struct ieee80211_local *local),
        TP_ARGS(local)
);

now.

> +bool ieee80211_schedule_txq(struct ieee80211_hw *hw,
> +			     struct ieee80211_txq *txq)
> +{
> +	struct ieee80211_local *local = hw_to_local(hw);
> +	struct txq_info *txqi = to_txq_info(txq);
> +	int ret = 0;

bool/false/true please.

> +struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw)
> +{
> +	struct ieee80211_local *local = hw_to_local(hw);
> +	struct txq_info *txqi = NULL;
> +
> +	spin_lock_bh(&local->active_txq_lock);
> +
> +	if (list_empty(&local->active_txqs))
> +		goto out;
> +
> +	txqi = list_first_entry(&local->active_txqs, struct txq_info, schedule_order);

that line seems pretty long, but I haven't counted :)

johannes

  parent reply	other threads:[~2017-10-17  6:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 16:09 Toke Høiland-Jørgensen
2017-10-16 16:09 ` [Make-wifi-fast] [PATCH 2/2] mac80211: Add airtime accounting and scheduling to TXQs Toke Høiland-Jørgensen
2017-10-17  7:07   ` Johannes Berg
2017-10-17  7:34     ` Toke Høiland-Jørgensen
2017-10-17 10:00       ` Johannes Berg
2017-10-17 10:09         ` Toke Høiland-Jørgensen
2017-10-17  6:39 ` Johannes Berg [this message]
2017-10-27 14:14 ` [Make-wifi-fast] [PATCH v2 1/3] mac80211: Add TXQ scheduling API Toke Høiland-Jørgensen
2017-10-31  0:14   ` kbuild test robot
2017-10-31  0:45   ` kbuild test robot
2017-10-31 11:27   ` [Make-wifi-fast] [PATCH v3 " Toke Høiland-Jørgensen
2017-12-14 11:33     ` Felix Fietkau
2017-12-14 12:15       ` Toke Høiland-Jørgensen
2017-12-14 12:44         ` Felix Fietkau
2017-12-14 14:34           ` Toke Høiland-Jørgensen
2017-12-19  9:44           ` Johannes Berg
2017-10-31 11:27   ` [Make-wifi-fast] [PATCH v3 2/3] mac80211: Add airtime account and scheduling to TXQs Toke Høiland-Jørgensen
2017-10-31 11:27   ` [Make-wifi-fast] [PATCH v3 3/3] ath9k: Switch to mac80211 airtime API Toke Høiland-Jørgensen
2017-10-27 14:14 ` [Make-wifi-fast] [PATCH v2 2/3] mac80211: Add airtime account and scheduling to TXQs Toke Høiland-Jørgensen
2017-10-27 14:14 ` [Make-wifi-fast] [PATCH v2 3/3] ath9k: Switch to mac80211 airtime API Toke Høiland-Jørgensen

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

  List information: https://lists.bufferbloat.net/postorius/lists/make-wifi-fast.lists.bufferbloat.net/

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

  git send-email \
    --in-reply-to=1508222380.10607.55.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=make-wifi-fast@lists.bufferbloat.net \
    --cc=toke@toke.dk \
    /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