From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C69CC43381 for ; Tue, 5 Mar 2019 16:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33AF820842 for ; Tue, 5 Mar 2019 16:44:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iIFdeskA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfCEQoW (ORCPT ); Tue, 5 Mar 2019 11:44:22 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:44463 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726854AbfCEQoW (ORCPT ); Tue, 5 Mar 2019 11:44:22 -0500 Received: by mail-yw1-f68.google.com with SMTP id x21so7448570ywx.11 for ; Tue, 05 Mar 2019 08:44:22 -0800 (PST) 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=60jRnLrKquUfGlYDnqhJZBdGig7jr0JU3BaA6dKqTSw=; b=iIFdeskAlWApK8F9tWmzXZ7SEZRequZbdzxFCpx8rEW5JtBmeXdSRtdIvPtNRoWlPv vF7yPMqgZBP2QFNVVyA+EUIwSOiAfxajGmCsITiF+AHxFbVBqRARu1dxIXCPygA0SIkP OSUfv3DMO/mO/3pF1yEnNPdZHXj+hX5aZvpncROhohr6JH0U7/DjFd/dIc3ZvmWL/EGu 00qzkIOJSzIu5LU6IptA8AAqSTFJMK76zrSB544+vgnpssdZ2bPqw1RMcEsXV/W02jR5 5Y5O9PzPiyjQO4KfaMHl1u0gkxmqrruo6elJwnJ8Ck5C3ICFw9so6pGdOvVN86xFZuY8 bYCg== 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=60jRnLrKquUfGlYDnqhJZBdGig7jr0JU3BaA6dKqTSw=; b=ugzrK/ugwx/G+zK3rb21Z6pWV0lSv330yfl7Q/9e1fwNyNs5zaSeUa7CQn3WEt2LNL C7M6ZtVrz2dh/xvL7gAHy562i2hUKqBh9dUkhyj4Lg5KJWHzrqmMuSm2XibXVt6rVjgG XmLIU+8LvH1Ro8vv6FmUhXLEObwhDO57XNpmXmnHYnS7R04h6JmeI1Nl+RcjzWbv+HFB 9gJ6AX1etIejwkHsrQAxJBgseXzQav1sswjVF2qBZmoM2Nh90P4U6VqYp4vM+oZacFIJ sfTkK7X3sNwRavWqd5ZutKHKpiLYQVZzVXNlLE+elhFz/XHbYEpdVEAfoXgvWm1vRDGE z/ew== X-Gm-Message-State: APjAAAU9ujBLYNcn8LhfUSJyUAWvtMTwHQQKEGzqN95bRXCIRD7AwWAF rzh4tSOrFS6b5QhncQtkkEksR3I7XU52CPZOwElmEQ== X-Google-Smtp-Source: APXvYqyQsg12RC4/OOoVmCeW+5zmmEa0H54D+RNXcHL3UzIiD+YiH57UA5CH6BGqcNXhjnfCWFb1NcLpr0iH2U52W+0= X-Received: by 2002:a25:4e08:: with SMTP id c8mr2888366ybb.160.1551804261487; Tue, 05 Mar 2019 08:44:21 -0800 (PST) MIME-Version: 1.0 References: <4a7d3903-971d-26ea-1d70-514abff88f91@virtuozzo.com> <85b6a52f-f997-6fc6-bc5a-99aaeaa27cc5@virtuozzo.com> In-Reply-To: From: Eric Dumazet Date: Tue, 5 Mar 2019 08:44:08 -0800 Message-ID: Subject: Re: [PATCH] tcp: detect use sendpage for slab-based objects To: Vasily Averin Cc: Eric Dumazet , netdev , Al Viro Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Mar 5, 2019 at 7:11 AM Eric Dumazet wrote: > > > > > My original suggestion was to use VM_WARN_ONCE() so that the debug checks would > > be compiled out by the compiler, unless you compile a debug kernel. > > > > Something like : > > > > diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c > > index ad07dd71063da09843ccfbd3e00d3f41567e1205..889563a66dde2a41c198d92a80183cf5382f632d 100644 > > --- a/net/ipv4/tcp.c > > +++ b/net/ipv4/tcp.c > > @@ -943,6 +943,9 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, > > ssize_t copied; > > long timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); > > > > + if (VM_WARN_ONCE(PageSlab(page)), "page must not be a Slab one") > > + return -EINVAL; > > + Well, VM_WARN_ONCE() returns 1 if !CONFIG_DEBUG_VM, so it is not behaving like WARN_ONCE(), which is unfortunate. But you get the idea ;) > > /* Wait for a connection to finish. One exception is TCP Fast Open > > * (passive side) where data is allowed to be sent before a connection > > * is fully established. > > > > > > For some reason you added a fallback :/ > >