From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id E4A3716E for ; Mon, 4 Dec 2017 10:24:48 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id y82so13738621wmg.1 for ; Mon, 04 Dec 2017 01:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=i8WcNGxIsni+CUaxFEpo4kMTGOduZaEr8m3DXrIWxNE=; b=mF0H6eR7lLcrbsQAvbeZlkDqqsUpyP2eT9prJxv95vCCAvrBYlSJYwNtZFt/pkMRL5 fgd2gHeblWl6B+dNZSgNmjIa0gp0N7vZw2LCkmFsHiJZEuuF57WDr5z/vU4j7t4mVOke m9bbYymzLbm9XaJSgFk4DT7W/hSPfVPjg9eZzNs48+IfqXBXeYxHegiuXvPrS3suWv4f wUd+RcavRqrDvmDZpEkzhm5JSB0Kqc7CxXC/sIZBhBn7VHgUdO51P6vnp/JmHm5ucZ1b vbvnmt+9m0THkv6vNFnsr2B1khz0tXw3pVFOwlt86CFQVPfdmtKVBz1wlaqV+YkH2dKe jPoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=i8WcNGxIsni+CUaxFEpo4kMTGOduZaEr8m3DXrIWxNE=; b=TrgKgcpFqo8B3Eo89ydOixy/qcc12r8tubWxiBjcAzeawdeby8NlnYuJLP+q6NKP/M gUtdt2L8qstv7WIKX8pydbliyCJ6PTBuL1aIjATDA+Kh/7cBidodpWU++qFDprc+dC8h N4kXCfKfpiP9bblLr7mY/ZtefP4jaY11QSoVf2Z+2xh84AmKjjiqz6hY9q7L6xN4/crj ro37LZlOr9PRSa1obeesgDZ6cikJZ1jjQVPXvTiDIkNWirVHwP8KXA4qvqH5U3KIiRrJ 0mLQCxLV7NzFHtXkV2mWmUzDMpJbqLvUA2yBH3nTYwwDln4OnWsSe2RteWit2KsIXepb uk6g== X-Gm-Message-State: AKGB3mI8/TNfwSomOud6IdzaUwMOr9pgERIU7YEqqnz6TntIluRvNUal tauCqtoXSiyc+3hqYXqHkNKH89916hsMpGVcWm3fOA== X-Google-Smtp-Source: AGs4zMbm9L2z1MuGhx9gfzpVXQ3StW8AmGthWH5oMuVXweoWusDCfgAAcpTwauR5MgU6QkXaQRmqfD8KZh7afr6zSdA= X-Received: by 10.28.134.130 with SMTP id i124mr5591876wmd.10.1512379488570; Mon, 04 Dec 2017 01:24:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.188.67 with HTTP; Mon, 4 Dec 2017 01:24:48 -0800 (PST) In-Reply-To: References: From: junlee Date: Mon, 4 Dec 2017 17:24:48 +0800 Message-ID: To: Jay Rolette Cc: users Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] KNI with RTE_KNI_PREEMPT_DEFAULT=n causes CPU soft-lockup X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2017 09:24:49 -0000 Hi, We fixed like below: use cond_schedule() to check whether there are other tasks (watchdog, rcu, etc) to run, if no, continue to handle packets. This can make CPU busy and performance is much better. Do you think this can be submitted? kni_thread_single(void *data) { struct kni_net *knet = data; int j; struct kni_dev *dev; while (!kthread_should_stop()) { down_read(&knet->kni_list_lock); for (j = 0; j < KNI_RX_LOOP_NUM; j++) { list_for_each_entry(dev, &knet->kni_list_head, list) { kni_net_rx(dev); kni_net_poll_resp(dev); } } up_read(&knet->kni_list_lock); #ifdef RTE_KNI_PREEMPT_DEFAULT /* reschedule out for a while */ schedule_timeout_interruptible( usecs_to_jiffies(KNI_KTHREAD_RESCHEDULE_INTERVAL)); #else /* schedule only if needed*/ cond_schedule(); #endif } return 0; } Thanks. BR//Wendy 2017-11-28 10:24 GMT+08:00 junlee : > We also tried to turn off the watchdog, then we got RCU stall. > INFO: rcu_sched self-detected stall on CPU > > Is there any system configuration that should be made before setting > RTE_KNI_PREEMPT_DEFAULT to n? > > > 2017-11-27 20:49 GMT+08:00 junlee : > >> Hi Jay, >> >> Thanks. >> We have read the thread before, increasing HZ to 1000 helps, but we are >> looking for latency even less than 1ms. >> The DPDK version is 17.05. >> >> The kernel preempt setting is: >> CONFIG_PREEMPT_NONE=y >> # CONFIG_PREEMPT_VOLUNTARY is not set >> # CONFIG_PREEMPT is not set >> >> Seems the watchdog/x process could not get chance to run >> when schedule_timeout_interruptible() is not called. >> >> Thanks. >> BR//Wendy >> >> 2017-11-27 20:36 GMT+08:00 Jay Rolette : >> >>> That shouldn't cause soft-lockups, but IIRC, there have been KNI bugs in >>> that past that would. Probably worth checking whatever version of DPDK you >>> are running vs. the tree for relevant fixes. >>> >>> Given what you are looking into, this thread may be of interest: >>> >>> http://dpdk.org/ml/archives/dev/2015-June/018858.html >>> >>> Jay >>> >>> On Sun, Nov 26, 2017 at 7:27 PM, junlee wrote: >>> >>>> Hi, >>>> >>>> We are testing KNI performance and finds the >>>> schedule_timeout_interruptible >>>> causes extra latency for packets. >>>> >>>> We tried to set RTE_KNI_PREEMPT_DEFAULT=n to reduce the latency, but >>>> ends >>>> up with CPU soft-lockup. >>>> >>>> Anybody knows how to make this work? >>>> >>>> static int >>>> kni_thread_single(void *data) >>>> { >>>> struct kni_net *knet = data; >>>> int j; >>>> struct kni_dev *dev; >>>> >>>> while (!kthread_should_stop()) { >>>> down_read(&knet->kni_list_lock); >>>> for (j = 0; j < KNI_RX_LOOP_NUM; j++) { >>>> list_for_each_entry(dev, &knet->kni_list_head, list) { >>>> kni_net_rx(dev); >>>> kni_net_poll_resp(dev); >>>> } >>>> } >>>> up_read(&knet->kni_list_lock); >>>> #ifdef RTE_KNI_PREEMPT_DEFAULT >>>> /* reschedule out for a while */ >>>> schedule_timeout_interruptible( >>>> usecs_to_jiffies(KNI_KTHREAD_RESCHEDULE_INTERVAL)); >>>> #endif >>>> } >>>> >>>> return 0; >>>> } >>>> >>>> Thanks. >>>> >>> >>> >> >