DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Wojciech Panfil <wojciech.panfil@intel.com>
Cc: bruce.richardson@intel.com, pallavi.kadam@intel.com,
	dev@dpdk.org,  jacek.kalwas@intel.com, konrad.sztyber@intel.com,
	dmitry.kozliuk@gmail.com,  roretzla@linux.microsoft.com,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH] eal/alarm_cancel: Fix thread starvation
Date: Fri, 4 Oct 2024 14:00:04 +0200	[thread overview]
Message-ID: <CAJFAV8x7Lk-XSuo6M1DDj8+DHAJ=Zaqs4GbEXQZcfF1+foA8zg@mail.gmail.com> (raw)
In-Reply-To: <20240925194206.106825-1-wojciech.panfil@intel.com>

On Wed, Sep 25, 2024 at 9:34 PM Wojciech Panfil
<wojciech.panfil@intel.com> wrote:
>
> Issue:
> Two threads:
>
> - A, executing rte_eal_alarm_cancel,
> - B, executing eal_alarm_callback.
>
> Such case can cause starvation of thread B. Please see that there is a
> small time window between lock and unlock in thread A, so thread B must
> be switched to within a very small time window, so that it can obtain
> the lock.
>
> Solution to this problem is use sched_yield(), which puts current thread
> (A) at the end of thread execution priority queue and allows thread B to
> execute.
>
> The issue can be observed e.g. on hot-pluggable device detach path.
> On such path, rte_alarm can used to check if DPDK has completed
> the detachment. Waiting for completion, rte_eal_alarm_cancel
> is called, while another thread periodically calls eal_alarm_callback
> causing the issue to occur.
>
> Signed-off-by: Wojciech Panfil <wojciech.panfil@intel.com>

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks (and welcome) Wojciech.


-- 
David Marchand


  parent reply	other threads:[~2024-10-04 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 19:42 Wojciech Panfil
2024-09-28 16:40 ` Stephen Hemminger
2024-10-04 12:00 ` David Marchand [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-18 11:39 Wojciech Panfil
2024-09-18 16:06 ` Stephen Hemminger
2024-09-18  7:02 Wojciech Panfil

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='CAJFAV8x7Lk-XSuo6M1DDj8+DHAJ=Zaqs4GbEXQZcfF1+foA8zg@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=jacek.kalwas@intel.com \
    --cc=konrad.sztyber@intel.com \
    --cc=pallavi.kadam@intel.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=stephen@networkplumber.org \
    --cc=wojciech.panfil@intel.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 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).