From patchwork Thu Jan 4 02:47:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soheil Hassas Yeganeh X-Patchwork-Id: 855352 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FrPQMoou"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zBsg358plz9s7M for ; Thu, 4 Jan 2018 13:48:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbeADCsM (ORCPT ); Wed, 3 Jan 2018 21:48:12 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:35480 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751991AbeADCsI (ORCPT ); Wed, 3 Jan 2018 21:48:08 -0500 Received: by mail-yw0-f194.google.com with SMTP id v187so129011ywc.2 for ; Wed, 03 Jan 2018 18:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cojH0ZNjYGI9ODX1yYg/c7b8t/zRA54v36eldiEuUAA=; b=FrPQMooude+ljtfB7BofrmGk3WcLSyNXoGK6ZZ3/DI9/ZmWm/ajSq9F+Vk//5DiTN5 ACbEIvRvHnIIrHEaBIxSfl66oeb7V/CdDqfpsdYRIf9U2TfsVgJ8fQJxmxHBZSeLYnSr SF71qKctCFd10AUPMEn9t0HivXKaJlm3NsBkh3dIsFaDWot2lTj3mpsiXc1lA+JD0ViA cgDj8KNwYLDpTnlfNmcS1u152L8t1L/Qxzh3l+COYF80ElKSCNv1/6l+kiyZlEwJgsXp H4aH9sxzg+buzT+RJAqcgORf3RqF0yGZnOzbn5bR4qKCuQBFvNejJrzSAKErWEDQfxiA TG5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cojH0ZNjYGI9ODX1yYg/c7b8t/zRA54v36eldiEuUAA=; b=do+kMOk5IVcoUyaAvIu1mn3zEJr2dBooMekDt3pZNKxea/ik7d2mM5L6z73b8XpmwS PnEaLqS9FFkOHzcKUTsIKF9YpudQ0uMH3P/VTe0SKk+bLD4sg63pxKL/Kyl4AXJO6ovf +GIuKkea4PBqaz3dumrKzYZFScaBUksJFwggls0YWFAIuseRncFAZ0UFTZpPtkTcTqRL xC7gPB1EvA4tBc0MFOdg0POpPXNq/A1btZBCb6MyDAQqd7zScj+ClCDM+MsxRA9bKS80 v/xFGmCc/BXVJBYMoC+WsDNfCvzv2qfx+9UWPJg8PiI0NOWWVel9SuCbahp7aaFQyYan 0S5A== X-Gm-Message-State: AKGB3mLFd4aqH1er6+eTgl5B82jLUhsNpiO+vbwhS7ZDQoo5C+YxRXf5 7uGPoyvauNKp8Waamhon1Uc= X-Google-Smtp-Source: ACJfBotYUXZw/KZMxO7p1rfALCGQuz0ktQKtWR3u7gMR6K4FBOVxNSQ1fbMbpCSDQikHrDfauQ+ugA== X-Received: by 10.129.81.147 with SMTP id f141mr3121774ywb.194.1515034088016; Wed, 03 Jan 2018 18:48:08 -0800 (PST) Received: from z.nyc.corp.google.com ([2620:0:1003:315:e2bf:c27f:ff24:b1be]) by smtp.gmail.com with ESMTPSA id w5sm1045646ywl.108.2018.01.03.18.48.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 18:48:07 -0800 (PST) From: Soheil Hassas Yeganeh To: davem@davemloft.net, netdev@vger.kernel.org Cc: pjt@google.com, ycheng@google.com, Soheil Hassas Yeganeh , Willem de Bruijn , Eric Dumazet , Neal Cardwell Subject: [PATCH net-next 2/2] net: revert "Update RFS target at poll for tcp/udp" Date: Wed, 3 Jan 2018 21:47:11 -0500 Message-Id: <20180104024711.257600-2-soheil.kdev@gmail.com> X-Mailer: git-send-email 2.16.0.rc0.223.g4a4ac83678-goog In-Reply-To: <20180104024711.257600-1-soheil.kdev@gmail.com> References: <20180104024711.257600-1-soheil.kdev@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Soheil Hassas Yeganeh On multi-threaded processes, one common architecture is to have one (or a small number of) threads polling sockets, and a considerably larger pool of threads reading form and writing to the sockets. When we set RPS core on tcp_poll() or udp_poll() we essentially steer all packets of all the polled FDs to one (or small number of) cores, creaing a bottleneck and/or RPS misprediction. Another common architecture is to shard FDs among threads pinned to cores. In such a setting, setting RPS core in tcp_poll() and udp_poll() is redundant because the RFS core is correctly set in recvmsg and sendmsg. Thus, revert the following commit: c3f1dbaf6e28 ("net: Update RFS target at poll for tcp/udp"). Signed-off-by: Soheil Hassas Yeganeh Signed-off-by: Willem de Bruijn Signed-off-by: Eric Dumazet Signed-off-by: Neal Cardwell --- net/ipv4/tcp.c | 2 -- net/ipv4/udp.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 7ac583a2b9fe..f68cb33d50d1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -498,8 +498,6 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) const struct tcp_sock *tp = tcp_sk(sk); int state; - sock_rps_record_flow(sk); - sock_poll_wait(file, sk_sleep(sk), wait); state = inet_sk_state_load(sk); diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index e9c0d1e1772e..db72619e07e4 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2490,8 +2490,6 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) mask |= POLLIN | POLLRDNORM; - sock_rps_record_flow(sk); - /* Check for false positives due to checksum errors */ if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) && !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1)