Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4678409ybe; Mon, 9 Sep 2019 12:50:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3a+ccGJ4LdlIPMyhJJGfjVRD/WYayvgegn4Pmziv41j3I8f5NCMOEb38OPHZ7GGWcaVfg X-Received: by 2002:a17:906:1d45:: with SMTP id o5mr21495602ejh.251.1568058633415; Mon, 09 Sep 2019 12:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568058633; cv=none; d=google.com; s=arc-20160816; b=Pnqw6DRb/PV5aE5q8KL3ImRVCuXhJF2YX1GWm47stJ8nkseJW8fsHLV11y/3GLKmIF XzWFKY8kvmuL2XWgQc5SDgIGGG3fAAWpsexkaTgbRCNIq7cYaAlcUUQNAinHp0YmGzAg YCl5RIxbYUmrWny1mW3hvbtM9vAlq2DhbuRrZbcq+b6thNUWm/qBVAjK1QjMSVEtzTcj AraVFBnu3/czDjp1GmFUswqYseM6RfaYa7HNXSREiWrprlAsEsXEzhfU4AkH3Ecno4OX dMyoo2Trulep//sYNIgthW3xUHduMZa38/wGVcebSvPbD8sewoDJ9tRcTIhY5Xoc25r1 qlfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OIovLqZ8dndVfgy4bS5bku+Skn01UN36L7YbEWe4yhw=; b=jvfKzMRfz2cKZYojrnL6CTpqtIEB9067ovoCq+4XgnmPCC0oZhqNDPYzB0oa1iCLaG qHZayVHbAgAmrlkR2V17AmgkZim2TlgRh9cZtXmU2IGvje004V2r1x1Q+QDblWix3B4V 3QI7b2Md/cfvckCecVwEfUc+ZaqNneJB9RMdP/KpFymJ50ko0bdN8Ub6Gl8Rw8YT5y3L ShmLCHkjNfoD/4++8+xoM+mUKTvUtHkAserBTk6hHATIkqXjUwYYViKRIafSD27bQrHZ Oh1UE3mQZ9smn7Yt+hv0an9015fBhuwPMKHnYHLgWN9YbpoRR/2yX3rqoj5k0UyNFEhh 0sSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lbxLDfcL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12si3925889ejc.390.2019.09.09.12.50.06; Mon, 09 Sep 2019 12:50:33 -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=@gmail.com header.s=20161025 header.b=lbxLDfcL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731972AbfIIBKY (ORCPT + 99 others); Sun, 8 Sep 2019 21:10:24 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40776 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731574AbfIIBKX (ORCPT ); Sun, 8 Sep 2019 21:10:23 -0400 Received: by mail-pf1-f196.google.com with SMTP id x127so8083376pfb.7; Sun, 08 Sep 2019 18:10:23 -0700 (PDT) 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=OIovLqZ8dndVfgy4bS5bku+Skn01UN36L7YbEWe4yhw=; b=lbxLDfcLHoEKq7QwulF8CGpwNbxQWZEmLCfz/9fdnClPG6kBHrUkUA87vaBr5UNBdS b+8jWVpHZ1drk30QaPgcvQNO7LtwRn5uadC72pzEBiJUIx+X1tBFQ1XlQiayEsqRe74w jCTab/fObzBXTYSVNx0DlDtckQzubsesiDGy+Oa//B0aXtJpRFB0snA1tjOKNeLySXaU BF70FBEwh04yA41fAXtr79jeOqocLTWCq1Z5V0wZjZxxYO6/hs0YIF95wGFS1rYroFet uhz1gSTV5eIHjp/f1WeABeVgz7DPHh4Fw42QOcIfDeWzqrOeiphZrfuzwIHu1MtBJzVi zRRw== 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=OIovLqZ8dndVfgy4bS5bku+Skn01UN36L7YbEWe4yhw=; b=K/ySBpEcozLgTFtmFnh5pJgoN3m+4q8dzl6f7befz7+v6RLUofAlvr4PwKX3Ov7P5j IJOHDvJQj6ci6mKfeA9bG42lMpnixnzRFWhFyJXTY5rHQRur6XMB4dWRAj9mQr8YPFzz bhBTwrIj4z834O8iyzSAr/tJuI8RgVmB8o6a8/8WInoLLu5L/233PBoVVYVe62ojp240 2hfXkOIsdzmzBPPp1G90vcvqVvWKxsidSwbDGSMwGEU8FIKcREebu1rMnDpaPpXyuP7N bcj4qTP0q2Ez9EyQ3fLpsviBn/9a2Wk85DzYJ0rnepTIDZC1OIbce83tquqdxhbsKUQk 2Ibg== X-Gm-Message-State: APjAAAWhksrILsaY4Rppp1lzvY1m3fllZNcWsOE1nBDF+HYqDXaa/ykc WCYKXoOGPgjyrvIFxrz58Bs= X-Received: by 2002:a63:1020:: with SMTP id f32mr19739610pgl.203.1567991423070; Sun, 08 Sep 2019 18:10:23 -0700 (PDT) Received: from localhost ([110.70.15.13]) by smtp.gmail.com with ESMTPSA id v43sm24235493pjb.1.2019.09.08.18.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2019 18:10:22 -0700 (PDT) Date: Mon, 9 Sep 2019 10:10:18 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , davem@davemloft.net, Eric Dumazet , Sergey Senozhatsky , Michal Hocko , linux-mm@kvack.org, Qian Cai , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] net/skbuff: silence warnings under memory pressure Message-ID: <20190909011018.GB816@jagdpanzerIV> References: <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> <20190905132334.52b13d95@oasis.local.home> <20190906033900.GB1253@jagdpanzerIV> <20190906153209.ugkeuaespn2q5yix@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906153209.ugkeuaespn2q5yix@pathway.suse.cz> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/06/19 17:32), Petr Mladek wrote: > > [..] > > > I mean, really, do we need to keep calling wake up if it > > > probably never even executed? > > > > I guess ratelimiting you are talking about ("if it probably never even > > executed") would be to check if we have already called wake up on the > > log_wait ->head. For that we need to, at least, take log_wait spin_lock > > and check that ->head is still in TASK_INTERRUPTIBLE; which is (quite, > > but not exactly) close to what wake_up_interruptible() does - it doesn't > > wake up the same task twice, it bails out on `p->state & state' check. > > I have just realized that only sleeping tasks are in the waitqueue. > It is already handled by waitqueue_active() check. Yes. > I am afraid that we could not ratelimit the wakeups. The userspace > loggers might then miss the last lines for a long. That's my concern as well. > We could move wake_up_klogd() back to console_unlock(). But it might > end up with a back-and-forth games according to who is currently > complaining. We still don't need irq_work, tho. If we can do printk()->console_unlock()->up()->try_to_wake_up() then we can also do printk() -> try_to_wake_up() It's LOGLEVEL_SCHED which tells us if we can try_to_wake_up() or cannot. > Sigh, I still suggest to ratelimit the warning about failed > allocation. Hard to imagine how many printk()-s we will have to ratelimit. To imagine NET maintainers being OK with this is even harder. -ss