All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Marc Sune <marc.sune-kpkqNMk1I7M@public.gmane.org>
Cc: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [PATCH] Adding RTE_KNI_PREEMPT configuration option
Date: Wed, 11 Feb 2015 14:27:39 +0000	[thread overview]
Message-ID: <20150211142739.GA7720@bricha3-MOBL3> (raw)
In-Reply-To: <54DB4A81.5040106-kpkqNMk1I7M@public.gmane.org>

On Wed, Feb 11, 2015 at 01:26:41PM +0100, Marc Sune wrote:
> 
> On 11/02/15 02:54, Zhang, Helin wrote:
> >
> >>-----Original Message-----
> >>From: Richardson, Bruce
> >>Sent: Tuesday, February 10, 2015 9:24 PM
> >>To: Marc Sune
> >>Cc: dev-VfR2kkLFssw@public.gmane.org; Zhang, Helin
> >>Subject: Re: [dpdk-dev] [PATCH] Adding RTE_KNI_PREEMPT configuration
> >>option
> >>
> >>On Tue, Feb 10, 2015 at 12:59:29PM +0100, Marc Sune wrote:
> >>>This patch of Nov 2014 hasn't been yet ACKed/NACKed. Could someone
> >>>please give some quick feedback?
> >>>
> >>>Thanks
> >>>marc
> >>>
> >>>On 07/11/14 12:00, Marc Sune wrote:
> >>>>This patch introduces CONFIG_RTE_KNI_PREEMPT flag. When set to 'no',
> >>>>KNI kernel thread(s) do not call schedule_timeout_interruptible(),
> >>>>which improves overall KNI performance at the expense of CPU cycles
> >>(polling).
> >>>>Default values is 'yes', maintaining the same behaviour as of now.
> >>>>
> >>>>Signed-off-by: Marc Sune <marc.sune-kpkqNMk1I7M@public.gmane.org>
> >>Although a better option would be to have a runtime setting, this is still an
> >>improvement over what we have.
> >>
> >>Acked-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> >>
> >>>>---
> >>>>  config/common_linuxapp                 |    1 +
> >>>>  lib/librte_eal/linuxapp/kni/kni_misc.c |    4 ++++
> >>>>  2 files changed, 5 insertions(+)
> >>>>
> >>>>diff --git a/config/common_linuxapp b/config/common_linuxapp index
> >>>>57b61c9..24b529d 100644
> >>>>--- a/config/common_linuxapp
> >>>>+++ b/config/common_linuxapp
> >>>>@@ -380,6 +380,7 @@ CONFIG_RTE_LIBRTE_PIPELINE=y
> >>>>  # Compile librte_kni
> >>>>  #
> >>>>  CONFIG_RTE_LIBRTE_KNI=y
> >>>>+CONFIG_RTE_KNI_PREEMPT=y
> >>>>  CONFIG_RTE_KNI_KO_DEBUG=n
> >>>>  CONFIG_RTE_KNI_VHOST=n
> >>>>  CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024
> >>>>diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c
> >>>>b/lib/librte_eal/linuxapp/kni/kni_misc.c
> >>>>index ba77776..e7e6c27 100644
> >>>>--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
> >>>>+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
> >>>>@@ -229,9 +229,11 @@ kni_thread_single(void *unused)
> >>>>  			}
> >>>>  		}
> >>>>  		up_read(&kni_list_lock);
> >>>>+#ifdef RTE_KNI_PREEMPT
> >>>>  		/* reschedule out for a while */
> >>>>  		schedule_timeout_interruptible(usecs_to_jiffies( \
> >>>>  				KNI_KTHREAD_RESCHEDULE_INTERVAL));
> >>>>+#endif
> >>>>  	}
> >>>>  	return 0;
> >>>>@@ -252,8 +254,10 @@ kni_thread_multiple(void *param)
> >>>>  #endif
> >>>>  			kni_net_poll_resp(dev);
> >>>>  		}
> >>>>+#ifdef RTE_KNI_PREEMPT
> >>>>  		schedule_timeout_interruptible(usecs_to_jiffies( \
> >>>>  				KNI_KTHREAD_RESCHEDULE_INTERVAL));
> >>>>+#endif
> >>>>  	}
> >>>>  	return 0;
> >As Bruce indicated, it would be better to do that at runtime, we can
> >add a config in struct rte_kni_conf, which will be copied to
> >struct rte_kni_device_info, then kernel space will know the configuration.
> >This way, we can enable/disable PREEMPT during KNI instance allocation time.
> 
> As I said before, I see the point on having it at runtime and I agree.
> 
> However, rte_kni_device_info is a struct that is per interface, not for the
> entire KNI subsystem, so it is kind of abusing to add a flag there when only
> will be used once, at bootstrap. To do it "properly" we should create a new
> ioctl() call IMHO.
> 
> >Anyway, it can be done now or later.
> 
> So, do we integrate the current patch, as acked by Bruce before?
> 
> Marc

I'd like to see it go in, as a step forward, rather than not having it at all
because it's not quite perfect.

One suggestion might be to have the compile time setting be
"CONFIG_RTE_KNI_PREEMPT_DEFAULT" rather than just "CONFIG_RTE_KNI_PREEMPT". This
would mean that we would not need to remove the setting later if we do add a
runtime option, as the setting only specified the default value rather than
the final value. :-)

/Bruce

  parent reply	other threads:[~2015-02-11 14:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 11:00 [PATCH] Adding RTE_KNI_PREEMPT configuration option Marc Sune
     [not found] ` <1415358037-424-1-git-send-email-marc.sune-kpkqNMk1I7M@public.gmane.org>
2015-02-10 11:59   ` Marc Sune
     [not found]     ` <54D9F2A1.2040102-kpkqNMk1I7M@public.gmane.org>
2015-02-10 12:02       ` Bruce Richardson
2015-02-10 12:21         ` Marc Sune
     [not found]           ` <54D9F7E3.2060504-kpkqNMk1I7M@public.gmane.org>
2015-02-10 13:22             ` Bruce Richardson
2015-02-10 18:06               ` Marc Sune
2015-02-10 13:24       ` Bruce Richardson
2015-02-11  1:54         ` Zhang, Helin
     [not found]           ` <F35DEAC7BCE34641BA9FAC6BCA4A12E70A806B40-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-11 12:26             ` Marc Sune
     [not found]               ` <54DB4A81.5040106-kpkqNMk1I7M@public.gmane.org>
2015-02-11 14:27                 ` Bruce Richardson [this message]
2015-02-12  9:25                   ` Marc Sune

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=20150211142739.GA7720@bricha3-MOBL3 \
    --to=bruce.richardson-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=marc.sune-kpkqNMk1I7M@public.gmane.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 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.