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=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 D2337C432C3 for ; Tue, 19 Nov 2019 00:41:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9708122316 for ; Tue, 19 Nov 2019 00:41:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OGvEwx/j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9708122316 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 670256B0005; Mon, 18 Nov 2019 19:41:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 620666B0006; Mon, 18 Nov 2019 19:41:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50F5A6B0007; Mon, 18 Nov 2019 19:41:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 397246B0005 for ; Mon, 18 Nov 2019 19:41:25 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id DA70A180AD815 for ; Tue, 19 Nov 2019 00:41:24 +0000 (UTC) X-FDA: 76171173288.07.shirt63_c49f448bcf3d X-HE-Tag: shirt63_c49f448bcf3d X-Filterd-Recvd-Size: 4885 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Nov 2019 00:41:24 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id q26so11197178pfn.11 for ; Mon, 18 Nov 2019 16:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VhycBUBk52oH8Q0uHteGPnTBWRxOGi22wCEAjXZ7q4E=; b=OGvEwx/jF362jbt4QLy5C+CcKvcX+0Luf/w7YPOfsos8KP0iPO0vnuavA1+DVlgJAb AIg7Bcx0KOYMvTRFdnMquBjqp7aO37bpWiJHuKgT6XDnCxGHh5ZVmrN6/t4Nc3mJUaa8 w4kItdPmwcrkV6r4phzeYVwyM0SZ1B6DzdEL2KCv6IjlxkMRjmKJBeFTKrMm9JMJHiB2 WB2/lIwCum5Tjljuho//j8iXsMjYuPE30xjEnpzn0yNtVGQmB1wCR/hb5FZ4hEEe5bTk jjXWk1KNBbhDRwqrwSz8P30uFW5DNxLS4DVP6/2+e0CFJUs8/spedCQwgozx65+E2Ans 1e4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VhycBUBk52oH8Q0uHteGPnTBWRxOGi22wCEAjXZ7q4E=; b=gwY8KYvHOhf33cQE47h+UfP9GYA/DA1t6bEoj9AzsJ1mcc05bYLxPwOpyYwsmmhr4/ Lg7RMXDl/i4v+5wJCd3kcsmPAGtGHN42RmHpbkegD+8Lxrte9jeGcBDIt2zfryh6xM0v 0FfP6iRMeryj7V7JzHlvqBhJ4zWskAqK0ugVJY0o7CXytA3oNxi/Uw2rKw9BGGtvdjGD +Y9KHOSrHENjBLISdbYDXPaIhwPfPJ+WGFswNW06MZeLWhSwnWOuda5aOuQjJdGyPC+6 +u8qc4ScwszBo9+Q33pFUIV3iQP6aaSCbBQHpNFbAISQKuFhD/sR3J9Fez4FfxlHxc12 XRcw== X-Gm-Message-State: APjAAAVlntX9FkLWS519lJfayHrGqa12bJA7VNGlrTznybdd/wnNZhPJ rNllEBAKuGeQyYK9qs2dcxg= X-Google-Smtp-Source: APXvYqx7cbZwsqcAnJabZDyjIHRiMhmcgRkk02vYONsF9R0zMO8Je0yZdAJHIWWVaDzyxZo1pD4xrg== X-Received: by 2002:a63:1c5c:: with SMTP id c28mr2288735pgm.241.1574124083207; Mon, 18 Nov 2019 16:41:23 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:250d:e71d:5a0a:9afe]) by smtp.gmail.com with ESMTPSA id h2sm4281561pgj.45.2019.11.18.16.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 16:41:21 -0800 (PST) Date: Tue, 19 Nov 2019 09:41:19 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Qian Cai , Sergey Senozhatsky , Steven Rostedt , Sergey Senozhatsky , Michal Hocko , Eric Dumazet , davem@davemloft.net, netdev@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/skbuff: silence warnings under memory pressure Message-ID: <20191119004119.GC208047@google.com> References: <20190904064144.GA5487@jagdpanzerIV> <20190904065455.GE3838@dhcp22.suse.cz> <20190904071911.GB11968@jagdpanzerIV> <20190904074312.GA25744@jagdpanzerIV> <1567599263.5576.72.camel@lca.pw> <20190904144850.GA8296@tigerII.localdomain> <1567629737.5576.87.camel@lca.pw> <20190905113208.GA521@jagdpanzerIV> <1573751570.5937.122.camel@lca.pw> <20191118152738.az364dczadskgimc@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191118152738.az364dczadskgimc@pathway.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) 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 (19/11/18 16:27), Petr Mladek wrote: > > > @@ -2027,8 +2027,11 @@ asmlinkage int vprintk_emit(int facility, int level, > > > pending_output = (curr_log_seq != log_next_seq); > > > logbuf_unlock_irqrestore(flags); > > > > > > + if (!pending_output) > > > + return printed_len; > > > + > > > /* If called from the scheduler, we can not call up(). */ > > > - if (!in_sched && pending_output) { > > > + if (!in_sched) { > > > /* > > > * Disable preemption to avoid being preempted while holding > > > * console_sem which would prevent anyone from printing to > > > @@ -2043,10 +2046,11 @@ asmlinkage int vprintk_emit(int facility, int level, > > > if (console_trylock_spinning()) > > > console_unlock(); > > > preempt_enable(); > > > - } > > > > > > - if (pending_output) > > > + wake_up_interruptible(&log_wait); > > I do not like this. As a result, normal printk() will always deadlock > in the scheduler code, including WARN() calls. The chance of the > deadlock is small now. It happens only when there is another > process waiting for console_sem. Why would it *always* deadlock? If this is the case, why we don't *always* deadlock doing the very same wake_up_process() from console_unlock()? -ss