Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4626429pxa; Mon, 10 Aug 2020 13:57:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNu2cNVS2xmlvBxTnHq30eJv8wUlM52iOqHWEUBFRALUpXQ6hlsFiHeb+N8rrMpiXsFK5W X-Received: by 2002:a50:fb10:: with SMTP id d16mr23153735edq.134.1597093056158; Mon, 10 Aug 2020 13:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597093056; cv=none; d=google.com; s=arc-20160816; b=hm+JeuraSza0JQ5L/sY4UQvytK5StZ2feQSPdDg1oXNQyphnvOLA9ENvlLZdVl9gRL wS2AOgrmvK7cZE/EqW4UwFAuJVrtQWFP7dacZx6XKpvZCMPU5c1pNoIQQca6p2iEoV9J rDYH1Qc7jerWt5Fdhy5r7+JtCcvk61tvcYpx2cYk9sDnsXHJMYGbq6bjr/2BLje6g91R u/gPyLfUjptunBvthyAafgFVSYkKoiZo285pB2UWx6Fu8JMChtJmJW+05k4MC7FYccAm dzKwF1cm1JXQ1OSWGBrPQtbtrRRgedOz7cU/DpHS1uzucJvT9Ie8G8AzZ/bsi3KPO4YY qhKA== 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:references:cc:to:from:subject:dkim-signature; bh=UJ2Vqlv4BvhpTJPAIFfyDD26d6ySQAJxv6Dxf08So/Y=; b=W6QdWGRobnEUtK2jxNJXP9/Il0d4tNdtao/G4WIUAT7vo++lheqTZOi51lcOHv4PzK XemAdJc4l8cKTbPd7a3MYtSPLu0/jNNESs+EqWt0sBp4MsGIs5mSD/QLKbPp6Aswmlnd r60LlWkf6AkKqgYmyFisvlvgfJWBJj08hkkgjig/F+sgS93o/hPJ8XYKunb9k09o/W24 4Hwq0hyXBgCCaJHApAf3SU8Eo8ga6qAaCsS7MXX1yqQz5RIgViV/EtYjpDGkORMp/z/M q0yh8lLLRH5BOkSO7UsYBjwC7wNdnNHYVsxAU/UtR4KvSM0bIzhM4IEIbfT396P4PeXv rL6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jUYumKYn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si11265000edy.251.2020.08.10.13.57.13; Mon, 10 Aug 2020 13:57:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jUYumKYn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726637AbgHJU4R (ORCPT + 99 others); Mon, 10 Aug 2020 16:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgHJU4R (ORCPT ); Mon, 10 Aug 2020 16:56:17 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED87C061756 for ; Mon, 10 Aug 2020 13:56:16 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id z14so11170290ljm.1 for ; Mon, 10 Aug 2020 13:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UJ2Vqlv4BvhpTJPAIFfyDD26d6ySQAJxv6Dxf08So/Y=; b=jUYumKYnqRT0iQ2kDFfTOTL1IwILe6T8kU49yLhhNL7K1ZbsgZxBiBU7RY27Cdjnq3 CsTUBh2hhfw54+eQkjXVU3r0w1SKzdY/Y6rM++6PeLGmgk1odTP40pY0MBxlcf0JK6/k Qif2FGPjmAgEuxvo/H3316omRBqQPEbtA5zXmqFcQS155QBaPQYEvJg6F8TsAVsBgz5S H88XBy+cluqajJAQgJkG/NjkMjXj7h2pe1hoHx4n6IzJn++BJ94IftIhUogZQ8csPGIS hahcmlxSUiNZSqTtiW0MEFyPv4RK6smv2B4HvNg8iq6ohGQ78zkwVpAaj47IuVrYbS5f N3Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UJ2Vqlv4BvhpTJPAIFfyDD26d6ySQAJxv6Dxf08So/Y=; b=fiTh/UGBA2yDKO/BGCoI07DSp84nF6PzxqsEE01vqWs3i2Mn1A9Cm5FkZri0sOlCcY //tHZV8MTSWQ38flFQByT+PaF0CYHHSAtB62/8eq4SIYLcEPaz5hfS335ZigLTA4m0BM LG637JL2ZWtpBJMlnzbxk2F8lekp2ikJiHfmANocYiXg08iBBvBCLsSEWk7bY74uT3qh BeWm6SoUzdqRuv8hZt/0D1+wKIo0O/K4uoBYxT57r1g0zIx2GYcyMZKxjHvoEal14mB8 CB3b7QlSHbt/3xlEJXe+K1huFdt3MYUK7FMP+V5wz82p/NmGcrVSzOGzTuA6F/QeQBCy wRkg== X-Gm-Message-State: AOAM5325ZgETZGC/wu4TJB5LMlxSPpKnaywi5u0DYaoXIYV8TdPMKGlK KAOcVhygVcSL5g2jyGtCwA+kjEi8 X-Received: by 2002:a2e:810c:: with SMTP id d12mr1363226ljg.34.1597092974837; Mon, 10 Aug 2020 13:56:14 -0700 (PDT) Received: from [192.168.2.145] (109-252-170-211.dynamic.spd-mgts.ru. [109.252.170.211]) by smtp.googlemail.com with ESMTPSA id t18sm10591147ljc.126.2020.08.10.13.56.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Aug 2020 13:56:14 -0700 (PDT) Subject: Re: regulator: deadlock vs memory reclaim From: Dmitry Osipenko To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Mark Brown Cc: Liam Girdwood , linux-kernel@vger.kernel.org References: <9a5c8ca6-2027-4d89-e290-6db564b99962@gmail.com> <20200810201846.GA12091@qmqm.qmqm.pl> Message-ID: <81e490af-d1da-873a-51b4-130ca82fd1f6@gmail.com> Date: Mon, 10 Aug 2020 23:56:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 10.08.2020 23:21, Dmitry Osipenko пишет: > 10.08.2020 23:18, Michał Mirosław пишет: >> On Mon, Aug 10, 2020 at 11:15:28PM +0300, Dmitry Osipenko wrote: >>> 10.08.2020 23:09, Michał Mirosław пишет: >>>> At first I also thought so, but there's more. Below is a lockdep >>>> complaint with your patch applied. I did a similar patch and then two more >>>> (following) and that is still not enough (sysfs/debugfs do allocations, >>>> too). >>> Then it should be good to move the locking for init_coupling() like I >>> suggested and use GFP_NOWAIT for the two other cases. It all could be a >>> single small patch. Could you please check whether GFP_NOWAIT helps? >> >> This would be equivalent to my patches. Problem with sysfs and debugfs >> remains as they don't have the option of GFP_NOWAIT. This needs to be >> moved outside of the locks. > > Ah okay, you meant the debugfs core. I see now, thanks. > This indeed needs a capital solution. It's not obvious how to fix it.. we can probably remove taking the list_mutex from lock_dependent(), but this still won't help the case of memory reclaiming because reclaim may cause touching the already locked regulator. IIUC, the case of memory reclaiming under regulator lock was always dangerous and happened to work by chance before, correct?