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 E5EDEC433B4 for ; Fri, 9 Apr 2021 08:44:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C548A61185 for ; Fri, 9 Apr 2021 08:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbhDIIoy (ORCPT ); Fri, 9 Apr 2021 04:44:54 -0400 Received: from outbound-smtp09.blacknight.com ([46.22.139.14]:36961 "EHLO outbound-smtp09.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhDIIow (ORCPT ); Fri, 9 Apr 2021 04:44:52 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp09.blacknight.com (Postfix) with ESMTPS id 56CBF1C37A9 for ; Fri, 9 Apr 2021 09:44:39 +0100 (IST) Received: (qmail 9048 invoked from network); 9 Apr 2021 08:44:39 -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 08:44:38 -0000 Date: Fri, 9 Apr 2021 09:44:36 +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: <20210409084436.GK3697@techsingularity.net> References: <20210409073046.GI3697@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 01:33:24AM -0700, Xie He wrote: > On Fri, Apr 9, 2021 at 12:30 AM Mel Gorman wrote: > > > > Under what circumstances do you expect sk_memalloc_socks() to be false > > and skb_pfmemalloc() to be true that would cause a problem? > > For example, if at the time the skb is allocated, > "sk_memalloc_socks()" was true, then the skb might be allocated as a > pfmemalloc skb. However, if after this skb is allocated and before > this skb reaches "__netif_receive_skb", "sk_memalloc_socks()" has > changed from "true" to "false", then "__netif_receive_skb" will see > "sk_memalloc_socks()" being false and "skb_pfmemalloc(skb)" being > true. > > This is a problem because this would cause a pfmemalloc skb to be > delivered to "taps" and protocols that don't support pfmemalloc skbs. 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? -- Mel Gorman SUSE Labs