Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2331040yba; Sat, 27 Apr 2019 21:27:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu/+Z5fuc/W7Mbh3iP70AKkpWX/2qRUQXn+J3+K6JIMyFlmGv3evX4Uh74+fbNIP54Pt6s X-Received: by 2002:a63:494f:: with SMTP id y15mr52135682pgk.56.1556425635762; Sat, 27 Apr 2019 21:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556425635; cv=none; d=google.com; s=arc-20160816; b=xdWX3CEWVEJHH8WedyHwdj+SIwegc6RZUF6oHOLHfeDSIZwglrZZoqnhlH+LcP/mrn HzqV61wLoxzZRwsR//7Eeaor+ODj/1BDkltNV7UDMI62KVnbLSqokGGkAUEthaxNShlM iK2OGdKwV6AjwuKyhHOD8Z/BWtU+71NJaidstE6SjRRI+ogQ4TG4gro0kF9H8BL3nHVj YM0SalIldPJu4lT71AMt146yRoneQBpuooQ6GgCMR/yNvfcWQBG1H+wBt8XaaBkLIgyI 3orKOi2ujstflhbD+kbtbgKShoycH8T7atM0CqMduxGqpGvuEc9k3TayEl3zeeqGVFNA SKLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MZPgGoe/EgGsYfUdYECAs+oYwy45HO1CB7CaztF2a00=; b=Fjk4LFQBRiqKma+wJB68gESqyKYS/3R3oRaUSb0FJ5tnc/8UWL8Dn1E1Fc+ccJfO71 XXNnr3pro3TDv8oDbVsT40IBLGvYVuOiOuqpiG59s94hMZHo2uXMIXOF8JlH7evNHDiR jPrnPF+6PJv3DsGOo6krQRIENNVMahlXDfsAOwSgwb1tcCajVD0cDtBi7s5UnErxJrIJ vd6dzbYZ4X+/gTU52vmDwEqgZiAiHEmabl8rCn2s5bb5wCiINDnrTRRZes070+H9EknD AWfQHS9IefLpOyiBW/z8Kh7iN/KG6CQp2tHjxquEekumD44HOussWUMrjjPHbCaVKcl9 QHtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si16423019pge.484.2019.04.27.21.26.24; Sat, 27 Apr 2019 21:27:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726377AbfD1EXT (ORCPT + 99 others); Sun, 28 Apr 2019 00:23:19 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:61434 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfD1EXT (ORCPT ); Sun, 28 Apr 2019 00:23:19 -0400 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id x3S4MndF079584; Sun, 28 Apr 2019 13:22:49 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp); Sun, 28 Apr 2019 13:22:49 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp) Received: from [192.168.1.8] (softbank126012062002.bbtec.net [126.12.62.2]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id x3S4MnQB079578 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Sun, 28 Apr 2019 13:22:49 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: unregister_netdevice: waiting for DEV to become free (2) To: Eric Dumazet , David Ahern , "David S. Miller" Cc: Julian Anastasov , Cong Wang , syzbot , ddstreet@ieee.org, dvyukov@google.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <0000000000007d22100573d66078@google.com> <4684eef5-ea50-2965-86a0-492b8b1e4f52@I-love.SAKURA.ne.jp> <9d430543-33c3-0d9b-dc77-3a179a8e3919@I-love.SAKURA.ne.jp> <920ebaf1-ee87-0dbb-6805-660c1cbce3d0@I-love.SAKURA.ne.jp> <15b353e9-49a2-f08b-dc45-2e9bad3abfe2@i-love.sakura.ne.jp> <057735f0-4475-7a7b-815f-034b1095fa6c@gmail.com> From: Tetsuo Handa Message-ID: <6e57bc11-1603-0898-dfd4-0f091901b422@i-love.sakura.ne.jp> Date: Sun, 28 Apr 2019 13:22:49 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <057735f0-4475-7a7b-815f-034b1095fa6c@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/04/28 8:52, Eric Dumazet wrote: > On 4/27/19 3:33 PM, Tetsuo Handa wrote: >> >> I'm waiting for davem why it is safe to move the dst entry from >> "a device to unregister" to "a loopback device in that namespace". >> I'm waiting for an explanation how the dst entry which was moved to >> "a loopback device in that namespace" is released (i.e. what the >> expected shutdown sequence is). > > The most probable explanation is that we make sure the loopback device > is the last one to be dismantled at netns deletion, > and this would obviously happen after all dst have been released. > rt_flush_dev() becomes a no-op if "dev" == "a loopback device in that namespace". And according to debug printk(), rt_flush_dev() is called on "a loopback device in that namespace" itself. If "a loopback device in that namespace" is the last "one" (== "a network device in that namespace" ?), which shutdown sequence should have called dev_put("a loopback device in that namespace") before unregistration of "a loopback device in that namespace" starts? Since I'm not a netdev person, I appreciate if you can explain that shutdown sequence using a flow chart.