Received: by 10.192.165.148 with SMTP id m20csp1218746imm; Wed, 25 Apr 2018 14:44:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/04YeLuwrDSpjAXMAg+FrpO95A+M/cIrHSakKpSp+xXIwYLSuGVUSpc66titd58ZcWkGFI X-Received: by 10.98.201.137 with SMTP id l9mr28876653pfk.221.1524692696491; Wed, 25 Apr 2018 14:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524692696; cv=none; d=google.com; s=arc-20160816; b=ZYdsm/Ih9KyRh1EwRk7Qu0lNPFo3Zt4sDe03wtsHxL9JFi75Bku+okBoQAnGzqwMNV EyAuKCviRcD6ViErT3sEjwucqrRxGo7NUZnxL54h1E1jXOPBXVq0gfv34wAMoWn6yimW 7B/V40Lsr0GsN0jheqZS+WzHy+Avsozyg4PteYhhO89n36mm+p/pN8omkaCncAIr5zRG C35ah15SvSjIOu0Nvu7UoZfcqARRr17LNV8ndCXuGrmrMk1ABCMzuNFUszo8fz8L1/4V 4FHSeVCI9qgzvM1u5iFumzwca0YIkFBE2h4475qb4XzGWRVjFl8G5MefX97Qre0GfE9f KNXA== 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=rj20HYZHvSHt/R8S8RGCPKJlK37svvXk3szEAnjbqV8=; b=yqRQHSzJw9YhV0Nxiq8TVwUliCbbaBWZMJPsdizffH6Xc+bsvdpHzw/bbodxueIv6z Gxt7ub+51DMHYdMis2Vk414z4f82onHBY5fruwaUTsb0CWjd4JFwxakWN0tipBajyIUo gFRxecK31r/pphUQjOGOF5Hpxxkfc8PFKqg83zj9NJI0gDhgnfLaZU5/GuC7zXGGdxVF 5LTDK2rTae5X3Bg7+yLt/RA3O98xnEszs1BkLw5u8LaDu/EQR3QeToIyEZps2saCfBMU 47gNrJoQMSqYI2mSS4yw5aFSXroWOZO6JCQRi/bJuNkb0kNKR+twfSnQN++uglMtmy9T yCCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aadX5q8p; 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 y9si14532404pgp.525.2018.04.25.14.44.41; Wed, 25 Apr 2018 14:44:56 -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=aadX5q8p; 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 S1753301AbeDYVnU (ORCPT + 99 others); Wed, 25 Apr 2018 17:43:20 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45899 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751887AbeDYVnR (ORCPT ); Wed, 25 Apr 2018 17:43:17 -0400 Received: by mail-pg0-f67.google.com with SMTP id i29so12749572pgn.12 for ; Wed, 25 Apr 2018 14:43:16 -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=rj20HYZHvSHt/R8S8RGCPKJlK37svvXk3szEAnjbqV8=; b=aadX5q8p9Morqzf6LeYzfJKLCTHtej38uAWYwDm0egqzrJufVYYcqwU/RT9YK2GaTG wKwpD2LJA/iMRnhU8gGvPLKGYFig5/dXPJ1WDnx8lniUFS6O2EiLQxmvmG78EIRWqlOl CfGXbSC7Wi+mySaSVd8ZOGZAm12CZ1vuy+K9FcjAWY5g+gUofCnQNdXDX19VnROP4y+o yZqeT1NvTVw/p1xOhy/XyXCZ1w6IKihW03LSwK4NUKdUF93vZzUE4FzgjgoooLGq1P4B zM+SRHt9o2DCYPJJ27Jll4yXUchJO86H9mt/57xXl0PcjscWpajqnPFvPPso04Z/cMYE GEyg== 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=rj20HYZHvSHt/R8S8RGCPKJlK37svvXk3szEAnjbqV8=; b=ZRXqWpiPk9GM9FjkUzDjHTZVcIxujlMVCX5iE/DXhgndIlsxyVwwmL7QjIfeUtFZnS RHVkILXBgHaM1PfH5eeDAX/hixbzhx6WFAWtGgVt6fEYslKR3cMBdY5qAHGDX/ImxN0D HTbDJMhlLmVVlbDgr3//XOb6P6n7Nkp8xC3zdWkNQ31N81pbBF7ayzWilb5MC7bKXVZM gHINavHeZkgCmKQHFqLen+Uee96Fo9urIU6saRsDalJtL0CYACw3vIWbkvao92e2nCpx JzQQyBeXGk4dc3ZQwF7UqWCVqMijGS/E2pio52il8o3AR+f4wKl7WGeurT+FPpmJvyxY ay4Q== X-Gm-Message-State: ALQs6tBE+jyoDl7kVXEQ8TuRf0H+x1bce2P7NQZdUY7Aj4RuB8lXsivQ qyNx3EhNdUhid9llfc2Wy9osdy7QAPA= X-Received: by 10.99.165.79 with SMTP id r15mr25748089pgu.236.1524692596067; Wed, 25 Apr 2018 14:43:16 -0700 (PDT) Received: from localhost ([2620:15c:2c4:201:f5a:7eca:440a:3ead]) by smtp.gmail.com with ESMTPSA id x5sm23795316pfh.115.2018.04.25.14.43.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Apr 2018 14:43:14 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Andy Lutomirski , linux-kernel , linux-mm , Eric Dumazet , Eric Dumazet Subject: [PATCH v2 net-next 0/2] tcp: mmap: rework zerocopy receive Date: Wed, 25 Apr 2018 14:43:05 -0700 Message-Id: <20180425214307.159264-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 setsockopt() operation and changes mmap() behavior. Second patch changes tcp_mmap reference program. 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/tcp.c | 189 +++++++++++++------------ tools/testing/selftests/net/tcp_mmap.c | 63 +++++---- 3 files changed, 142 insertions(+), 118 deletions(-) -- 2.17.0.441.gb46fe60e1d-goog