Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1175124pxf; Fri, 9 Apr 2021 01:45:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9zOIMEODQWnAWOYWbiV2pA8UY3IyhNDyR2uUO7nYUD32o0NGumt4fn7a4fjOM05Pr/DIF X-Received: by 2002:a05:6402:278d:: with SMTP id b13mr16299546ede.34.1617957956992; Fri, 09 Apr 2021 01:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617957956; cv=none; d=google.com; s=arc-20160816; b=oQ08y5ldHJvfU7Zkdu+7m1KDe8H/aipQXKgjFPKaSOy+jhnWUw6J7ZT/0c4iVo3Y13 dZLiRLh3r0wEKY3/Kz661kMkroKtDS7ZOD4a+cIjKCXOrfUIhV95R5c1+Na3Pgdui62/ ohre4638iFTP3465auuJipdL6lKTwxs2ANi8X5vBWLWu7XeDPMJTbYXRK77uop358POm ESU2dPNaxk0mhtoPyw3Xt31MJqJ2SD1emfqcv8N7BddJDsweIRd+G0bnCLIrGTIeQx/S 7jRAPRDaJTq+yLYg6ioHi1+0orNWv8qGMDElOLqMsxQ7GD8tNhUo02zJ6rpeRJ+G1tWE 1WNw== 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=DsHPIJzePflHNwNY1Ndjutf8rbRQdtCjE5fGijruNBo=; b=oDM8dqfm706lmTyqK9BS3FNQMia6D3v6m337oE+kbTwkjClqCYM1aIVyyyOeg/WdHY xtSvdA66t/elQ0A7glg9wRUnCcEz5J5QccRL0hByQgnN1BZtC5mWFJjoL0O0yO55vl0J yEvgwfahMHtVJBfOlP7rTWCWx1RT7zsWDVw6aMi4H38veD5Kpv6AYo5HjSkWodZE9KfS QkSm/209TM8ZzmS8BVf2oMxq2/d7CPlIZYsxNh/IrHzzK2GAqMmOcMETOjJAuOrddcFi dg7IT8cbrCpErksQZBK4n/QBJfWuhnFv3lo53WznA+vR+p2w+ZTzX9yihpL8OsKWP/pB OcZw== 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 p21si1757763edm.361.2021.04.09.01.45.33; Fri, 09 Apr 2021 01:45:56 -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 S231611AbhDIIox (ORCPT + 99 others); Fri, 9 Apr 2021 04:44:53 -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