Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4979232imm; Tue, 9 Oct 2018 08:01:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV621kRofbS+5W7rgtfGsgakC1Z/OLO43gqMvFjPQuAIMvjOqPp4hQp6gI/faz43jpm4Fxnad X-Received: by 2002:a62:4e09:: with SMTP id c9-v6mr30482402pfb.105.1539097262683; Tue, 09 Oct 2018 08:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539097262; cv=none; d=google.com; s=arc-20160816; b=nNYlJur8cNW2LDr8ES543uzhPBKOcWp4UNA7ghBTB4uMglyWHQb799tiK/04/UdCSs Ew0nPPYVNBTawhLgjKCbphJyKXz7zyOeehE3nyFO0O2OQUrcoZ88B6UOk2Mcu4pLLBJg iDkaWglYtlh75wemefwpUqHAlCyuhf42HUNHnLJtgc/uxTUZxYcpYsjkR5O4WuhH4ESq h2j6ByYGQ6oPnhuDi8r2xMWVF7EhLEdT8er4DS5TX2/DnG2AOcnEyh3WKeaLS38CBu87 n4zc4yqSrRu7QukQLcNKp0DJNU5G3nE2uYpUf0/Pa7q7RvzCqjBwWpcOjFrt6GqhC5Kt nKJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=znF2dXmEw6I6sqhqCgrR/LkxoK0WiWJksvm1s3zT76g=; b=ykA3X5uL/ntx6xKWg95rqaMGFJWevu9dDbj+8mAO58KiKeKlivCzLkIoxqdVptoJPN cfWR8Wna36esPUBVFTPd67Fnt0ycFmrM34jRhYEgq2379wtWjj+dloMwYNfa4cnGFDQr mS3scKXbtjEJuSVyBad+ww3ChVt4AVzafcY2cIg6RteEszbIuN51358fCgG6vs8tA4+5 fID7EVN0Uwq0pXN5ChcilIWSzhBZ95vxEEbcPvey26rC5iK1Pr/oPhCZ635LlKYTyAG/ CDmsk51Afj+LZPyluDayhfZ+Jz/RgGz7X9ejLzrkORfDcH16Jmz2BUAErqd8Mv2IGT// vEVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y6zYIaV+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si21797863pla.422.2018.10.09.08.00.44; Tue, 09 Oct 2018 08:01:02 -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=@google.com header.s=20161025 header.b=Y6zYIaV+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbeJIWPr (ORCPT + 99 others); Tue, 9 Oct 2018 18:15:47 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:35448 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbeJIWPr (ORCPT ); Tue, 9 Oct 2018 18:15:47 -0400 Received: by mail-it1-f195.google.com with SMTP id p64-v6so3140023itp.0 for ; Tue, 09 Oct 2018 07:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=znF2dXmEw6I6sqhqCgrR/LkxoK0WiWJksvm1s3zT76g=; b=Y6zYIaV+DO0dswyKV5aR0hPeFc9/VaiDArVrzBoWIdDJBu1kJXVDPDqekHI4bsu1Z/ phzwMeQQmMPJ4vDOmkUtps/HoA+vslDRDUUOvfeaOZHwkFcXIsrzz3vLJJWY2wmtPlDw jGxT+0NUnu6uITGdOvM9unzD+sLC9nbG0yUFiqPMA31DLyoU/HH678BMCgKIxoH8uirs lrxyj/0oIG6+UCR7vhUnuP0zXGP7Kr0a8tVJdaVf2grrAxwQR+zaoIynamiIZGww3JTT mABV6f/K0+PMjQV90u7KvmhG9DgWIahoLO7pyzmq0jiEiO0VbcNlEg7+nvanYwUzZL4F xbYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=znF2dXmEw6I6sqhqCgrR/LkxoK0WiWJksvm1s3zT76g=; b=DRK60WC0BcbowO7Q4AzRvxyDjukJy14RQt6cdHuwjSJI2U97W1MYQbNUde2kXtWO7M Q3XyIDeEs0lTlECmFBDhOVPE7NESJ4b/XkNHK4GOr/sh3TaPGYgitqyrhU7tZASfDk3H IWl3Xvjpj/hdIzWAYY5whZZ/Kc1LQ/NP/LtIRv6X5fvlmFBMPQB6VySVPlN48oLiTmLO ujtynDTOJvT5HcjLf4a+5bELgNfZ//vRVEfwh7v5+v6acDVYnDTvw7gD9XLZzTfZaDxy diHEOELDnPLrmxXrl5F21zh5qE5/dYq8eRZqXPBHvsjulTwtcCOpgwLFMXNXEergaixP 9exw== X-Gm-Message-State: ABuFfojlMW+HtmXjAF0lJsPC+AfcSVYatyoLTwRlLpQm+ekIBGrGRAhs yHHLcq0/fXoZbCoP4jEAgKg0CCPcky7B/VvvTcONNfYVa5k= X-Received: by 2002:a24:f803:: with SMTP id a3-v6mr1952791ith.178.1539097106924; Tue, 09 Oct 2018 07:58:26 -0700 (PDT) MIME-Version: 1.0 References: <1539086718-4119-1-git-send-email-laoar.shao@gmail.com> <1539086718-4119-2-git-send-email-laoar.shao@gmail.com> In-Reply-To: From: Eric Dumazet Date: Tue, 9 Oct 2018 07:58:14 -0700 Message-ID: Subject: Re: [PATCH net-next] tcp: forbid direct reclaim if MSG_DONTWAIT is set in send path To: Yafang Shao Cc: David Miller , netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > There was a network latency (hunreds msecs or even one sec ) recently > on our production enviroment. > And finally I diagnosed that this latency was caused by direct reclaim > in tcp_sendmsg. > That issue could be resovled by keeping a reserved memory. > But I think deeply that why not forbid direct reclaim if we set MSG_DONWAIT. > So I did this change and tested it. The application got a errno > returned instead of being blocked in send path. > That's why I sumbit this patch. Sure, and I asked you how you have tested it, because it seems clear to me that you missed the real memory allocation point (We fill up to 64 KB of page fragments memory into one (small) skb) And how is the application going to use MSG_DONTWAIT in the real world, I do wonder as well. We do not add bloat in the kernel if no application is ever going to use it, especially in the TCP fast path. Give us a test, so that we can see how this can be used... Thanks.