From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbcGFIPm (ORCPT ); Wed, 6 Jul 2016 04:15:42 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:22454 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752475AbcGFIPh (ORCPT ); Wed, 6 Jul 2016 04:15:37 -0400 Subject: Re: [PATCH] ipv6: Fix soft lockup for ipv6 network notifier. To: Eric Dumazet References: <57761E04.8030202@huawei.com> <1467359847.11238.34.camel@edumazet-glaptop3.roam.corp.google.com> <5776258F.6080008@huawei.com> <1467361396.11238.35.camel@edumazet-glaptop3.roam.corp.google.com> CC: , , , Eric Dumazet , "David S. Miller" , Netdev , Cong Wang From: Ding Tianhong Message-ID: <577CBE0E.1050809@huawei.com> Date: Wed, 6 Jul 2016 16:15:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1467361396.11238.35.camel@edumazet-glaptop3.roam.corp.google.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.22.246] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.577CBE1A.009A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: f609852f733554f6e6dffb1ee9387724 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/7/1 16:23, Eric Dumazet wrote: > On Fri, 2016-07-01 at 16:10 +0800, Ding Tianhong wrote: >> On 2016/7/1 15:57, Eric Dumazet wrote: >>> On Fri, 2016-07-01 at 15:38 +0800, Ding Tianhong wrote: >>> ... >>>> net/ipv6/addrconf.c | 6 ++++++ >>>> 1 file changed, 6 insertions(+) >>>> >>>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c >>>> index f555f4f..e294a3d 100644 >>>> --- a/net/ipv6/addrconf.c >>>> +++ b/net/ipv6/addrconf.c >>>> @@ -3284,6 +3284,12 @@ restart: >>>> spin_unlock_bh(&addrconf_hash_lock); >>>> } >>>> >>>> + /* >>>> + * It is safe here to schedule out to avoid softlocking if preempt >>>> + * is disabled. >>>> + */ >>>> + cond_resched(); >>>> + >>>> write_lock_bh(&idev->lock); >>>> >>>> addrconf_del_rs_timer(idev); >>> >>> Seeing you apparently cooked your patch against an old kernel (which >>> one ?) ... >>> >>> I tried vanilla net-next kernel, and apparently I could not trigger the >>> softlockup you mentioned. >>> >>> Are you sure current kernel has a bug to begin with ? >>> >> have you disable the preempt? The problem will disappear if you enable the preempt voluntary or preempt. >> CONFIG_PREEMPT_NONE=y >> # CONFIG_PREEMPT_VOLUNTARY is not set >> # CONFIG_PREEMPT is not set >> >> I test the 4.1 lts kernel and found this problem, and I didn't found any patch to fix this from linux 4.1, but I will try to test in 4.7 kernel version. > > I usually do not have PREEMPT enabled in my kernels. > > $ grep PREEMPT .config > CONFIG_PREEMPT_NOTIFIERS=y > CONFIG_PREEMPT_NONE=y > # CONFIG_PREEMPT_VOLUNTARY is not set > # CONFIG_PREEMPT is not set > > Also the whole script is quite fast on latest kernels. I am guessing you > are chasing an already fixed problem. > > Hi Eric: I had found out that the patch aaf92f(netfilter: conntrack: resched in nf_ct_iterate_cleanup) solve the problem, this patch add cond_sched() in the nf_ct_iterate_cleanup() which will be called in the net notifier chain every time, and I revert this patch at kernel 4.7-rc4 , it will panic for soft lockup, so I am not sure whether our patch is need, it looks like if I disable the CONFIG for netfilter that would register the nf_ct_iterate_cleanup as notifier, the problem still be exist. Thanks. Ding > > > . >