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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 03D38C43460 for ; Fri, 9 Apr 2021 09:59:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D9406124A for ; Fri, 9 Apr 2021 09:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233978AbhDIJ7r (ORCPT ); Fri, 9 Apr 2021 05:59:47 -0400 Received: from outbound-smtp45.blacknight.com ([46.22.136.57]:46741 "EHLO outbound-smtp45.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233801AbhDIJ6Z (ORCPT ); Fri, 9 Apr 2021 05:58:25 -0400 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp45.blacknight.com (Postfix) with ESMTPS id B232EFAA0C for ; Fri, 9 Apr 2021 10:58:10 +0100 (IST) Received: (qmail 26435 invoked from network); 9 Apr 2021 09:58:10 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 9 Apr 2021 09:58:10 -0000 Date: Fri, 9 Apr 2021 10:58:08 +0100 From: Mel Gorman To: Xie He Cc: Mel Gorman , jslaby@suse.cz, Neil Brown , Peter Zijlstra , Mike Christie , Eric B Munson , Eric Dumazet , Sebastian Andrzej Siewior , Christoph Lameter , Andrew Morton , "David S. Miller" , Jakub Kicinski , Linux Kernel Network Developers , LKML Subject: Re: Problem in pfmemalloc skb handling in net/core/dev.c Message-ID: <20210409095808.GL3697@techsingularity.net> References: <20210409073046.GI3697@techsingularity.net> <20210409084436.GK3697@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Apr 09, 2021 at 02:14:12AM -0700, Xie He wrote: > On Fri, Apr 9, 2021 at 1:44 AM Mel Gorman wrote: > > > > That would imply that the tap was communicating with a swap device to > > allocate a pfmemalloc skb which shouldn't happen. Furthermore, it would > > require the swap device to be deactivated while pfmemalloc skbs still > > existed. Have you encountered this problem? > > I'm not a user of swap devices or pfmemalloc skbs. I just want to make > sure the protocols that I'm developing (not IP or IPv6) won't get > pfmemalloc skbs when receiving, because those protocols cannot handle > them. > > According to the code, it seems always possible to get a pfmemalloc > skb when a network driver calls "__netdev_alloc_skb". The skb will > then be queued in per-CPU backlog queues when the driver calls > "netif_rx". There seems to be nothing preventing "sk_memalloc_socks()" > from becoming "false" after the skb is allocated and before it is > handled by "__netif_receive_skb". > > Do you mean that at the time "sk_memalloc_socks()" changes from "true" > to "false", there would be no in-flight skbs currently being received, > and all network communications have been paused? Not all network communication, but communication with swap devices should have stopped once sk_memalloc_socks is false. -- Mel Gorman SUSE Labs