From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FDB1C433E0 for ; Mon, 1 Mar 2021 17:45:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D038B65359 for ; Mon, 1 Mar 2021 17:45:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D038B65359 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4D1168D008D; Mon, 1 Mar 2021 12:45:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 47E938D0063; Mon, 1 Mar 2021 12:45:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36D0C8D008D; Mon, 1 Mar 2021 12:45:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id 1D9118D0063 for ; Mon, 1 Mar 2021 12:45:32 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D223B180ACF75 for ; Mon, 1 Mar 2021 17:45:31 +0000 (UTC) X-FDA: 77872032462.19.E6CD5C1 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf21.hostedemail.com (Postfix) with ESMTP id 4840EE005F16 for ; Mon, 1 Mar 2021 17:45:17 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1614619438; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YlRwdOzbL8RLSRzwItUwbMXUiIvnCooahFkWHhdiBtc=; b=MWXMF20Pccl/hIQ2lCGRmBq7fMTaMeUrO+KuXsnVcTy+o9hQiUrLkZXo9F8qVhozNAa6m+ ZSkBPYoRNc2dSidzOllDOiVXOBtk6OpJbbgSStuS7IuDEpfALSHZ1fo7uc29pd4tKWMkBu oQAjAHny3QfxG0FhboYVzxSWP5PgsWo= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3B624B023; Mon, 1 Mar 2021 17:23:58 +0000 (UTC) Date: Mon, 1 Mar 2021 18:23:57 +0100 From: Michal Hocko To: Shakeel Butt Cc: Mike Kravetz , syzbot , Andrew Morton , LKML , Linux MM , syzkaller-bugs , Eric Dumazet , Mina Almasry Subject: Re: possible deadlock in sk_clone_lock Message-ID: References: <000000000000f1c03b05bc43aadc@google.com> <7b7c4f41-b72e-840f-278a-320b9d97f887@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4840EE005F16 X-Stat-Signature: hup6a1hnabnj4pjp8sb1qhcjmsjph7ia Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614620717-947273 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 01-03-21 08:39:22, Shakeel Butt wrote: > On Mon, Mar 1, 2021 at 7:57 AM Michal Hocko wrote: [...] > > Then how come this can ever be a problem? in_task() should exclude soft > > irq context unless I am mistaken. > > > > If I take the following example of syzbot's deadlock scenario then > CPU1 is the one freeing the hugetlb pages. It is in the process > context but has disabled softirqs (see __tcp_close()). > > CPU0 CPU1 > ---- ---- > lock(hugetlb_lock); > local_irq_disable(); > lock(slock-AF_INET); > lock(hugetlb_lock); > > lock(slock-AF_INET); > > So, this deadlock scenario is very much possible. OK, I see the point now. I was focusing on the IRQ context and hugetlb side too much. We do not need to be freeing from there. All it takes is to get a dependency chain over a common lock held here. Thanks for bearing with me. Let's see whether we can make hugetlb_lock irq safe. -- Michal Hocko SUSE Labs