Received: by 10.192.165.148 with SMTP id m20csp883816imm; Fri, 27 Apr 2018 09:02:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp+KqR4IK6sAWSfe1Bpgxu3MMYEgK1xJkMSgW9wWGZE3EH0IoCCLX0EETopQMtA1RoV9/5U X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr2758867plb.144.1524844941134; Fri, 27 Apr 2018 09:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524844941; cv=none; d=google.com; s=arc-20160816; b=KEPJ3grkgaY5tQbzlPl0CFJRalVNngSZfU4nepyL+DkQ8c/5Ww6Epvvd9nIHpUXWdd 1N3D3a4gdBjoRdeRojolFACKyfjnw8tludjCuP0DL1dOgoKSsPic/IdArTh772FGXOz1 n4TcKT+hibmlXdLOiabCJxI2iJGiRvOd4sYq5xEAG3+cu2oVC3Y2uSZQfqQr29Zzw3nD UMW3XSeWAuH5nJ8QmjlLChk1MkkM1MQQRE9jhJ8OPwd2wFkZWn90ItkAxedNwMbDqVx+ FnHqZjNgw/7KI9yof7Boi2FsLKKrMvTV0FQwqemwSGfvuHsinlZ2z62eqx/mwTrTMYyw 7poQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=tMIfI27rqgMOqys03EmcJ/DeMIvVEGC4FM/7nizT5aQ=; b=FDEBSn484/4pUd0zeugB4xCkX/jBjj8wm28m107zhey+6HhimifsrPYwpQiG37C0BV /387AwyoMmhxRbpXJQwtrXZHu3/b4meowzteaNAEKnqEZeorBLCrftvOQg6Flt2wNnVw QdLGgurlYt7r0PUB4WfkrHShOVtrpnHHa/loYMYxYreLtsR1PNanZ+HBItAdyc6+6iw0 rB/56AnFGXHHYtcL44l4EwDP8uT1kK+p7hl2DEAW3dz8ef1SvlSeY5z3K/nFdljBsWeW hByY8CF3SVk/xDEb6MUnQqqsdJsd9IzwCf4FoSWUvbFtjJtMdxkFM5CZVEwh8a851XOh ZbEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dKk2b7Un; 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 f96-v6si1466150plb.418.2018.04.27.09.02.06; Fri, 27 Apr 2018 09:02:21 -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=dKk2b7Un; 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 S1758607AbeD0P6X (ORCPT + 99 others); Fri, 27 Apr 2018 11:58:23 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:46453 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758236AbeD0P6T (ORCPT ); Fri, 27 Apr 2018 11:58:19 -0400 Received: by mail-wr0-f195.google.com with SMTP id d1-v6so2240742wrj.13 for ; Fri, 27 Apr 2018 08:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=tMIfI27rqgMOqys03EmcJ/DeMIvVEGC4FM/7nizT5aQ=; b=dKk2b7UnozPvg9pOPXiJSpk0PquDJphXxRbw+ZE1r8Fw1I975Xq4J8wGIEuY0r3RHz 5GKCUvLVZvxhhLN8P0LJn/R81lQCdWkOw3wr5D5oSIaY+L0dzcsUXrcpYK5bmf9wV/ST GfO1x1VHap+W+kLacP7narewAzUYjyuqvJSVgcuz8QtFw60SvwBh2XkktYhBHWE0Nlvm Sq42tP4Yg/5opDCGA/n+B1Fr6Xj8VTsBnfCViTtlNQ0819G2R7c9boi1c7c+ZVWJUuF/ PKZoOncab5tQ8ckAMI3MeZ9cBVL+qA7T9GjqjlA9rX9P6sgenSIuDpwV0/06aAZukKn0 4Nzg== 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; bh=tMIfI27rqgMOqys03EmcJ/DeMIvVEGC4FM/7nizT5aQ=; b=pgdpmEjLr1eIGDyWmMEc8msvMnD6ZIz8yJmqY4BpJGSmfcln04Y2zInoeMA/bgSeOT H3QG25SHjEo4CzlcWDYfHna4CL65ILoqJk024khcpnyGF8TNcoZE0Ae3f0TXRrZJuasD EmuRFBWWCT8JN1W8YVV5WT0dZCRVupBasGsZ9fW83+BlXV3r5+wp1OTiJDKW7setgzR/ zx2tkhgiiJgcbQbDIDzJFukn++lmCXOikYKuR7E+79r75lprkEp8Ipiir+44uVVXgfya EfYxo2LBZ23dt1eF3SZ1CKtbLLdP65xc1u3tEIuOD0mIEISv3XxZJYkmSQBKugFARNSY gPEA== X-Gm-Message-State: ALQs6tD0Kko+Qqh1q7BzNj29VWGV5hSqS1K8OlctyP4XYgLt2JdjcUdr KmHpVFzTp1TAidbuCmHk0L9ZRg== X-Received: by 2002:adf:a970:: with SMTP id u103-v6mr2146384wrc.71.1524844698211; Fri, 27 Apr 2018 08:58:18 -0700 (PDT) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id 19-v6sm3534241wrz.7.2018.04.27.08.58.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Apr 2018 08:58:17 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Andy Lutomirski , linux-kernel , linux-mm , Ka-Cheong Poon , Eric Dumazet , Eric Dumazet Subject: [PATCH v4 net-next 0/2] tcp: mmap: rework zerocopy receive Date: Fri, 27 Apr 2018 08:58:07 -0700 Message-Id: <20180427155809.79094-1-edumazet@google.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syzbot reported a lockdep issue caused by tcp mmap() support. I implemented Andy Lutomirski nice suggestions to resolve the issue and increase scalability as well. First patch is adding a new getsockopt() operation and changes mmap() behavior. Second patch changes tcp_mmap reference program. v4: tcp mmap() support depends on CONFIG_MMU, as kbuild bot told us. v3: change TCP_ZEROCOPY_RECEIVE to be a getsockopt() option instead of setsockopt(), feedback from Ka-Cheon Poon v2: Added a missing page align of zc->length in tcp_zerocopy_receive() Properly clear zc->recv_skip_hint in case user request was completed. Eric Dumazet (2): tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive selftests: net: tcp_mmap must use TCP_ZEROCOPY_RECEIVE include/uapi/linux/tcp.h | 8 + net/ipv4/af_inet.c | 2 + net/ipv4/tcp.c | 196 +++++++++++++------------ net/ipv6/af_inet6.c | 2 + tools/testing/selftests/net/tcp_mmap.c | 64 ++++---- 5 files changed, 154 insertions(+), 118 deletions(-) -- 2.17.0.441.gb46fe60e1d-goog