All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Avinash Patil <patila@marvell.com>
Cc: "linux-wireless\@vger.kernel.org"
	<linux-wireless@vger.kernel.org>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Cathy Luo <cluo@marvell.com>, Zhaoyang Liu <liuzy@marvell.com>,
	Shengzhen Li <szli@marvell.com>
Subject: Re: [PATCH 1/4] mwifiex: avoid queue_work while work is ongoing
Date: Thu, 05 Mar 2015 13:33:25 +0200	[thread overview]
Message-ID: <87vbif65mi.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CBACCFA0AEB13A41977475BCF3E896FC66746954D8@SC-VEXCH2.marvell.com> (Avinash Patil's message of "Wed, 4 Mar 2015 22:38:52 -0800")

Avinash Patil <patila@marvell.com> writes:

>> > From: Marc Yang <yangyang@marvell.com>
>> >
>> > Current code does not check whether main_work_queue or rx_work_queue
>> > is running when preparing to do queue_work, this code fix add check
>> > before calling queue_work, reducing unnecessary queue_work switch.
>> >
>> > This change instead sets more_task flag to ensure we run main_process
>> > superloop once again.
>> >
>> > Signed-off-by: Marc Yang <yangyang@marvell.com>
>> > Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
>> > Signed-off-by: Shengzhen Li <szli@marvell.com>
>> > Signed-off-by: Cathy Luo <cluo@marvell.com>
>> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
>> > Signed-off-by: Avinash Patil <patila@marvell.com>
>> 
>> Really, it took six persons to write this patch? Or do you just dump the same
>> names to each patch?
>
> This should have been "Reviewed-by". Apologies.

Ok, Reviewed-by would make more sense here. Please use that in the
future (no need to change anything for these patches).

>> > +void mwifiex_queue_main_work(struct mwifiex_adapter *adapter) {
>> > +	unsigned long flags;
>> > +
>> > +	spin_lock_irqsave(&adapter->main_proc_lock, flags);
>> > +	if (adapter->mwifiex_processing) {
>> > +		adapter->more_task_flag = true;
>> > +		spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
>> > +	} else {
>> > +		spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
>> > +		queue_work(adapter->workqueue, &adapter->main_work);
>> > +	}
>> > +}
>> > +EXPORT_SYMBOL_GPL(mwifiex_queue_main_work);
>> > +
>> > +static void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter) {
>> > +	unsigned long flags;
>> > +
>> > +	spin_lock_irqsave(&adapter->rx_proc_lock, flags);
>> > +	if (adapter->rx_processing) {
>> > +		spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
>> > +	} else {
>> > +		spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
>> > +		queue_work(adapter->rx_workqueue, &adapter->rx_work);
>> > +	}
>> > +}
>> 
>> I can apply this patch, but to me this looks like a horrible hack.
>
> We are here trying to avoid requeueing another work when work item is
> being executed. We set more_task flag to true if work item is being
> executed and mwifiex_main_process would execute superloop once again
> if more_task it set. work_pending() cannot be of much help here since
> we want to avoid queing only when work item is being executed. Could
> you please let us know if you think of any better way to handle this?

It would be best to modify workqueue code to support this instead of
doing this in the driver. But this was just an observation I made while
reviewing your patches, I'll apply these anyway.

-- 
Kalle Valo

  reply	other threads:[~2015-03-05 11:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 16:50 [PATCH 0/4] mwifiex: throughput enhancements for TX Avinash Patil
2015-02-25 16:50 ` [PATCH 1/4] mwifiex: avoid queue_work while work is ongoing Avinash Patil
2015-03-03 12:37   ` Kalle Valo
2015-03-05  6:38     ` Avinash Patil
2015-03-05 11:33       ` Kalle Valo [this message]
2015-03-05 11:39         ` Avinash Patil
2015-03-05 11:54           ` Kalle Valo
2015-02-25 16:50 ` [PATCH 2/4] mwifiex: get rid of BA setup helper functions Avinash Patil
2015-02-25 16:50 ` [PATCH 3/4] mwifiex: remove_bss_prio_lock Avinash Patil
2015-03-03 12:39   ` Kalle Valo
2015-02-25 16:50 ` [PATCH 4/4] mwifiex: preprocess packets from TX queue Avinash Patil

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=87vbif65mi.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@codeaurora.org \
    --cc=akarwar@marvell.com \
    --cc=cluo@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=liuzy@marvell.com \
    --cc=patila@marvell.com \
    --cc=szli@marvell.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.