Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5666768ybp; Tue, 8 Oct 2019 06:36:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqQGc7JfmQDblKnBccORi/i9puQv3NVSD9u2HzWCObThV5glm0Yykg6uq1o4uLf/WIu5mL X-Received: by 2002:a50:934c:: with SMTP id n12mr34496188eda.12.1570541765499; Tue, 08 Oct 2019 06:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570541765; cv=none; d=google.com; s=arc-20160816; b=XOonhTty17urrSdNm2G3T3FPxWcwHjx6ERJp2ZFQQ2+lWcC3k7blRBrrT0gByuOiSL DP4f76CrxBy5tdTP5dttRhslv8ExJy5VvXFZs6jUUXdMMt1brpNmOy4/eIFPS0fQKm+Y /sLCQGEUGHs4zJXPNvtlptOgN0/NBhsG7KrdkQet6iZnSOsaVBbgQOCCNX6BMVJf0msR exS3X0cMg0XHhEbjZxG1EGzHQixZSg2S/aVnaqU+Vr/d+wb3NcwKf2dCa4U+YAM9Hs/k EsjvTRuwSysqVdCR+lygZwjS94VESeCYRPFdVRlZdrMiJAO2pjpgNaSKIbUXesq5oHDt FPQQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=QnQzIXsBirdC9ZGjzsM1M3X/RwdPQQ7F+7TxSRPMNrM=; b=SCnJuxjEnQYpIqhgUhrAFbbpKgfc1TxByKuYV4AUoivGpmohgIUCAK9OnIGeFrRRfS CVJlR9OIS9DR3oC2v2uG0vIbJMYhviT6rYno+gfYnn940YnZjOkV1apuy3Hg6pT00M7A 02crPX190rLiyAb87abDVyGaHNy9dIou0jq4Ja8By17jL+9yNQmT7gsMEtiETXBmSVR4 naJm2sbY7yYF1JhZvc/NGhJIq4uHjBT3Io4PWKoFMXDW8lIqwB3JXKO2HFe/RAZFq85O S6+qD9GZrcgs4E7JCUWpptDyMLdqYZxh70uBqeL2GPtI9owhL/Wga8wTLKJ4ln114EjN LWAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Ey59fqbx; 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 c21si8885346ejx.295.2019.10.08.06.35.41; Tue, 08 Oct 2019 06:36:05 -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=@lca.pw header.s=google header.b=Ey59fqbx; 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 S1731041AbfJHNdp (ORCPT + 99 others); Tue, 8 Oct 2019 09:33:45 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35855 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730301AbfJHNdo (ORCPT ); Tue, 8 Oct 2019 09:33:44 -0400 Received: by mail-qk1-f194.google.com with SMTP id y189so16758491qkc.3 for ; Tue, 08 Oct 2019 06:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=QnQzIXsBirdC9ZGjzsM1M3X/RwdPQQ7F+7TxSRPMNrM=; b=Ey59fqbx1Y2Eb6IGPCNXsY7xoiPbBNRsc9vMKzUETVH0/4nu8i9qwD4Ovxhft2vTAN lGELYw9QYNIAz3VIcb9v3JBSIu0b/gSt1O+WsZXn7iAxeSMeuzPyyOQBBc1rqIT1esR4 B3bc8yOB+0xpj3+BilklfufVZo7UkC5B0pUes3biBm4QJkWCbNxcus3wdNZoX/3QNZyV yFuhcMz0g8u9XKn2Km80XMOtEwHDJcM+zZ/U4L2GIDblC6izBYPTqOZuQjSNHoQ1sV+I NlC04V0V+WMKjYrVIPSJhmRtln/gF8bOUF06bZTv5GmccmXwWBZ8NOM976AcbQRE/FS7 1kAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=QnQzIXsBirdC9ZGjzsM1M3X/RwdPQQ7F+7TxSRPMNrM=; b=VaGX/5z9IwbX6Kh1T77cSJT4i6j5PztZWBhJth9Gt2XkmRLQAym+Kz/hpiS15iCbPr 1bwIZYj9yTYLB8M8SzF0oLisC7lwA9kS+WJwWUKKG6hSTo9Hz4rOIB9Xe+SAH4Gts5kA k8blBXmLGX7tj1O4m2AE0/r4x7sQGcsOrCLCmtY3OU+QqzCxvcYH5KRFlFfbmZ3Canoy nc9vLT8bucLQIYU2SiLpH0J6pNtpirAJF1VkQ02RrUieb1y0EAZ57/NRCy5QFSI4zRkQ /UUeo1PwD9cYWV7psUTRfQoxROQU4qkax6zu9T/dcBSKliQk2fyp5xPI533SWLlf1244 e+jw== X-Gm-Message-State: APjAAAXCMRtYDoqdUXTOxmo2iGcW+AJ0wKWLcCnJ2/muJEbEq86EkFjk EHcnVoc93DCT5lrrNtrrmLxtug== X-Received: by 2002:a37:9782:: with SMTP id z124mr26583062qkd.78.1570541623638; Tue, 08 Oct 2019 06:33:43 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id c16sm9514575qkg.131.2019.10.08.06.33.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 06:33:43 -0700 (PDT) Message-ID: <1570541621.5576.299.camel@lca.pw> Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() From: Qian Cai To: Petr Mladek Cc: sergey.senozhatsky.work@gmail.com, rostedt@goodmis.org, peterz@infradead.org, mhocko@kernel.org, linux-mm@kvack.org, john.ogness@linutronix.de, akpm@linux-foundation.org, david@redhat.com, linux-kernel@vger.kernel.org Date: Tue, 08 Oct 2019 09:33:41 -0400 In-Reply-To: <20191008130803.jf3xdtyt3qpfotn5@pathway.suse.cz> References: <1570228005-24979-1-git-send-email-cai@lca.pw> <20191007143002.l37bt2lzqtnqjqxu@pathway.suse.cz> <1570460350.5576.290.camel@lca.pw> <20191008130803.jf3xdtyt3qpfotn5@pathway.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-10-08 at 15:08 +0200, Petr Mladek wrote: > On Mon 2019-10-07 10:59:10, Qian Cai wrote: > > It is almost impossible to eliminate all the indirect call chains from > > console_sem/console_owner_lock to zone->lock because it is too normal that > > something later needs to allocate some memory dynamically, so as long as it > > directly call printk() with zone->lock held, it will be in trouble. > > It is not normal the something needs to allocate memory under > console_sem. Console drivers are supposed to get the message > out even when the system is in really bad state and it is not > possible to allocate memory. I consider this a bug in the console > driver. Again, it is not directly under console_sem. It is *indirect*. console_sem --> lockA lockA --> lockB lockB --> lockC Anything allocating memory with lockB or lockC held will form the problematic lock chain to trigger the lockdep splat with memory offline.