Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp687769img; Fri, 22 Mar 2019 06:36:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYUcmqMGoWFd1qrt4TZbAYRH1WnoNAbSLWShffxUFqYEKDAXrdaUkKaSfKRbpDtw/Y2IKm X-Received: by 2002:a17:902:2e01:: with SMTP id q1mr9722586plb.253.1553261794685; Fri, 22 Mar 2019 06:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553261794; cv=none; d=google.com; s=arc-20160816; b=YJrbKZMgTcm4MbVM9SxNlXqOC41vv6fyXu4EOHQt46BG08cE05U+eVauBGqjX/HLSI QT5U1X+DR10a4F7e0FlzeL1pBIofNI451bf6cyMEk+7l/9QDhsAxGUyXfhGZPJUxwYy1 l/B14GxqYTnf7cmhwpzaV/3evYgeAhGscKIYK5jWBFJ7hSBZZBBOHxUd971B5M1Ek+4C EWDpXlhbFCT09MQTmE0H4Tm66d4LoWrHIT9jK+oaB0UJAdICRsilmC2mf6HzUpZwLxnh yllabZ31RwzklJiA/GTKkwJ01UXCebxJDn6oA3KVxO42RIBVceE+4i/ldnGwEjzEx/1p lZuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=qaj+rrfMmbl7BGJVKze/WH0CQNUG1q6xaEGKClgfykE=; b=qOt6dRA+Gc8QJWvEGxruBvSuwHcE07l066xp0n+O3+z/PFTZ60R7jTq6O78fKD1Aau 9th4TtU5bPoR4FozpAl2isH7HIHoc3vX2LIzQbZIqFkUhNvxdX/kosFZI0I7EQ0ixzrJ n81DNETKxf7t7owV/a2uRYU4999ZqVKh9iKlyRvjR3PbFO4pkzvGbJ5MgK9EAMSOEgx2 Am90GzvHiBLOKOEtkYkBhTdUF1Ap+lIdfEk+e+iQNGp+pJFqt7m3iVhdy0RC2d8fxr/B d86db1e0Lh/wizFA/uKhzkP1UGvWaDDDq1Uo67zyen87c9/8Ge1y10qj7EXbowytQBXz ohKw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66si7202035plc.88.2019.03.22.06.36.17; Fri, 22 Mar 2019 06:36:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728594AbfCVNfV (ORCPT + 99 others); Fri, 22 Mar 2019 09:35:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58817 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728225AbfCVNfU (ORCPT ); Fri, 22 Mar 2019 09:35:20 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3969B3003989; Fri, 22 Mar 2019 13:35:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.32.181.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B3A75C708; Fri, 22 Mar 2019 13:35:18 +0000 (UTC) Message-ID: <22dbfd8bc2c200e648bf69ac8557d0ee1406ac2d.camel@redhat.com> Subject: Re: [net-next PATCH v3 4/8] net: Change return type of sk_busy_loop from bool to void From: Paolo Abeni To: Eric Dumazet Cc: Christoph Paasch , Alexander Duyck , netdev , LKML , "Samudrala, Sridhar" , David Miller , Linux API Date: Fri, 22 Mar 2019 14:35:17 +0100 In-Reply-To: References: <20170324164902.15226.48358.stgit@localhost.localdomain> <20170324170812.15226.97497.stgit@localhost.localdomain> <0eb092b7ca67942f52e36c672d20f130f1d54e1e.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 22 Mar 2019 13:35:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-03-22 at 05:59 -0700, Eric Dumazet wrote: > On Fri, Mar 22, 2019 at 3:33 AM Paolo Abeni wrote: > > Hi, > > > > On Thu, 2019-03-21 at 23:05 -0400, Christoph Paasch wrote: > > > On Thu, Mar 21, 2019 at 12:43 PM Alexander Duyck > > > wrote: > > > > On Thu, Mar 21, 2019 at 2:45 AM Paolo Abeni wrote: > > > > > The following - completely untested - should avoid the unbounded loop, > > > > > but it's not a complete fix, I *think* we should also change > > > > > sk_busy_loop_end() in a similar way, but that is a little more complex > > > > > due to the additional indirections. > > > > > > > > As far as sk_busy_loop_end we could look at just forking sk_busy_loop > > > > and writing a separate implementation for datagram sockets that uses a > > > > different loop_end function. It shouldn't take much to change since > > > > all we would need to do is pass a structure containing the sk and last > > > > pointers instead of just passing the sk directly as the loop_end > > > > argument. > > > > > > > > > Could you please test it? > > > > > > > > > > Any feedback welcome! > > > > > > > > The change below looks good to me. > > > > > > I just tried it out. Worked for me! > > > > > > You can add my Tested-by if you do a formal patch-submission: > > > > > > Tested-by: Christoph Paasch > > > > Thanks for testing! > > > > I'm trying to reproduce the issue locally, but I'm unable. I think that > > the current UDP implementation is not affected, as we always ensure > > sk_receive_queue is empty before busy polling. > > But right after check is done we release the queue lock, so a packet might > come right after the test has been done. Yep I was unclear and uncorrect. My point is: with the current UDP implementation, if we have a non empty sk_receive_queue after the busy loop, it always means there are more packets to be processed and we should loop again, as we currently do. AFAICS, that is different from the reported issue, where the system stall looping around sk_receive_queue while no new packets are appended there. Cheers, Paol