Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2538660ybp; Sat, 5 Oct 2019 14:25:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPeHAi+Ms3SKk/3YzE/qvDCSKK2BuMOLKHkWlFMruZaLzNeFxuD+G9ZkS0MYeKcbv/HDk8 X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr17698924ejb.114.1570310727366; Sat, 05 Oct 2019 14:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570310727; cv=none; d=google.com; s=arc-20160816; b=LXKgkK8RS3Y5Qfzq/rrTN1EuIJq+L4IbdlgTGEsRi3YNNUMtCMcPM8Y3km16Go64a6 tD0a0twRZOJ/JnSqUMwZnY0D9x4ZrI6fwPTglDk18vmzEIjFxAcg38Ie1cTfI7ykEsix wFPXwMJvmZUg+sYd9Fgipdz7C8oZKZ0/GnPtto5QqPnxeHR3Gk9737mFCz9z8hrMbi5X 0sd//kUNVL1fQd+uf+0CBJ+gQbvw/yFIsbHa7qJthtqLefs12yTuodnZpV1aMYaQEgPh KYtcu1dHwqC1fi/+gRXqqB6aRH4srDQTCR+qoNSqhgrDAB+QJP945D5m4QvImcO77iZU JiUw== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=e9USW3DJyrGv4N1WMMe9E7kdeRGl3DoyeWl7RCnh9dw=; b=hZpRe8+oko2TjSgc14XIktnDS+JAiY9QyxehcjoLNMTwAgJu4ZBAYl7ELa87VBcwym pQmhv3fhk5aXLtLF7fvF9NWaAGA1UzyJvsKLjz4NPzRXXoSxmx7+0LsZrR3DHyrvshKP Yo5oE+kAfE2ikJzvpYJXHpee0Hfx3xw5vzdbtZwqAD3hHPk8q+R6hJlD5VXVwURZQY8S SCZuVn4MPkVLMbCfKMmWV930+WUyfBAADS0vvfahqxBJH3L+G2t+x8MhXqs3+sFWpusi CusQ6z1mw0SNfqZhKIgslhUIRvtEdLJM46RHeYy1Xjjs4TMfobZsMlK6fiCRHlM5lO5/ CT9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vomw4Odz; 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 h48si5803804ede.31.2019.10.05.14.25.01; Sat, 05 Oct 2019 14:25:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Vomw4Odz; 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 S1725853AbfJEVWg (ORCPT + 99 others); Sat, 5 Oct 2019 17:22:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbfJEVWg (ORCPT ); Sat, 5 Oct 2019 17:22:36 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76E39222C5; Sat, 5 Oct 2019 21:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570310553; bh=b2ojuscvA5vHZZCIRcmyr63IQh+4Z67dn4JCAN9oUvI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Vomw4Odzzw6K7rO6NN4INokEnUY6gIv4thk7COYozO8+LUEx2QuMV+Pq8PZVl+7oa Nx5x+M1wSdYtnKovrxGVdUAzPbhBR+C04UtI6ublLEyzQxdZKdUWvDyYP07mNo5cbN LpFB/bMGN6ywLBW0Gt6P5gpkqiWgnYJpxSvNwIgo= Date: Sat, 5 Oct 2019 14:22:32 -0700 From: Andrew Morton To: Michal Hocko Cc: Qian Cai , Anshuman Khandual , linux-mm@kvack.org, Vlastimil Babka , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() Message-Id: <20191005142232.e08976cf8905824fad0533ff@linux-foundation.org> In-Reply-To: <20191004144150.GO9578@dhcp22.suse.cz> References: <1570090257-25001-1-git-send-email-anshuman.khandual@arm.com> <20191004105824.GD9578@dhcp22.suse.cz> <91128b73-9a47-100b-d3de-e83f0b941e9f@arm.com> <1570193776.5576.270.camel@lca.pw> <20191004130713.GK9578@dhcp22.suse.cz> <1570195839.5576.273.camel@lca.pw> <20191004133814.GM9578@dhcp22.suse.cz> <1570197360.5576.275.camel@lca.pw> <20191004144150.GO9578@dhcp22.suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Oct 2019 16:41:50 +0200 Michal Hocko wrote: > > > This is just insane. The hotplug code is in no way special wrt printk. > > > It is never called from the printk code AFAIK and thus there is no real > > > reason why this particular code should be any special. Not to mention > > > it calls printk indirectly from a code that is shared with other code > > > paths. > > > > Basically, printk() while holding the zone_lock will be problematic as console > > is doing the opposite as it always needs to allocate some memory. Then, it will > > always find some way to form this chain, > > > > console_lock -> * -> zone_lock. > > So this is not as much a hotplug specific problem but zone->lock -> > printk -> alloc chain that is a problem, right? Who is doing an > allocation from this atomic context? I do not see any atomic allocation > in kernel/printk/printk.c. Apparently some console drivers can do memory allocation on the printk() path. This behavior is daft, IMO. Have we identified which ones and looked into fixing them?