Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1216168pxf; Fri, 9 Apr 2021 03:02:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx+wuDdwAuw6QMeJoP9XnFnxHSwUXdT0sCKhMM0355Xu532rjwNIdxhBPWhcHAqp4iupqw X-Received: by 2002:a17:90a:13c3:: with SMTP id s3mr6327887pjf.59.1617962571500; Fri, 09 Apr 2021 03:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617962571; cv=none; d=google.com; s=arc-20160816; b=oQXgql0ZLhc5Q0V9aMwNM1JTkxVCtbzIu5vHwX26NpbBrB7p0S2Sn9d29rl7MZ84Lm 70c/jC2LkRQp80dgh//KNXLjIDgTH+AsICWwNq2KRBL2TnnEqc5OnB+IL0Gpm36mAxfX 3I85tLjtZsdt2Akow4CPK5OZ0gJBOF7/re6MTeMl0xMnzmyo2OBfBtsfI4o/waV++3xI DOTSX1z8MpG9HNR2izXgPfg0cLz2qz+GvKdvGXP2dcto9FfAznft6k+8OmJ+sO21rWOo 8CeUHlOuzYcZ3s8UvRzx754Cz5RCPvxAzxlJB2nHB8OY/5xnHeE65FWZzYlQ5na4Cfj9 kqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=r82m0cGrUh/ysO4KWeSFuLaEGSjMKv8Huxx5BPhgntE=; b=LVi/cKXRrCPA/lZ3yYjTo6h/xSthYaM5yn80oIIMiEy1SQvUtM6puUcSGWWRGNsVPm Pd/5hf8ta2+UGoWA7L1TvVfEeu0ete8osYr3o7YjyIVZOQ0LNsMY9Gz7uguXGsm1BpVt jkMLk9AhVTcxrDjDXPKK3OwLl6N00aL6WIAlFcklz8BcPeY1bXYecYaIUHl/VcrCqwbp sU6MmU6oa2BrV4k8Hl6k9tWHXrdi7AyAbVFL6UaoiNFOEvkqNWR78FBTOqonv8QZDLEy wplEYRa/JzBXhQmcZN0okiOpiUnqXY/WYpaGE4pi482Kmy72sGPjLlD5aEG5iv+2WnyG bj3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u189si2497421pgc.148.2021.04.09.03.02.39; Fri, 09 Apr 2021 03:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233545AbhDIKBG (ORCPT + 99 others); Fri, 9 Apr 2021 06:01:06 -0400 Received: from outbound-smtp14.blacknight.com ([46.22.139.231]:60261 "EHLO outbound-smtp14.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233799AbhDIJ6Y (ORCPT ); Fri, 9 Apr 2021 05:58:24 -0400 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp14.blacknight.com (Postfix) with ESMTPS id AF4D21C3A14 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: linux-kernel@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