Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1170445pxf; Fri, 9 Apr 2021 01:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOxdrXhhMY9ut1WMhYJH4KxKlcAIsxo7kC0WgD7uv2egJthM+wJY7raxWsHKA0tsATXowd X-Received: by 2002:a17:902:8697:b029:ea:a5dc:925f with SMTP id g23-20020a1709028697b02900eaa5dc925fmr763361plo.56.1617957405874; Fri, 09 Apr 2021 01:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617957405; cv=none; d=google.com; s=arc-20160816; b=MGOZbgXylaCf+uPGWRh2KDRtWdZ6QG8skTqCHEt8S/RiMCXtR98/ysCICIwrdHnaB5 9WKdslSnApz5HTtfVvD6UMrKtcjkFs89+XO0EJ0CufbGK3+fcfMFxEpefOrbTWQpsmSg /NXugN4VvgZLr61tBVveZiz2ZyenbJc4IlAf3YHNUM8A0OA5UsxWgNGhsxasJYCDgisI RbmWflG2cUp80tRBWstmn8j4mJ34guEnW/53YwPF1rVwq9F/nBfdFHxGPFoiehxGz2du baWsylfsW/saHqdFMUyO0gdEpC+vloORn6jVQlpeHtexszig9qkjMAHB44trwbBvYKt/ +h2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lhOBDBWPuZntGK3npBwjF9tJqRpBOuEpoer/aWNxmFg=; b=Ecvw8vkTtdhJK2yrwjOflXuwviZ9EmjdRVMw04ngLrBu4GHDzASkwoydT9lbSIkXkV RN35apGofVhyYUAeozkahQlUAYa0+sq6E6uL0rEpmBNqwmok2COXN234WGuVfvzYuk7A nIilM9l/sbp38DOZm9tqYr71gWV4wushFn1I6b7gevAkCUbS455PjS5dJBX+8rRsI3GT C+baxoaD8aOGhFxGtClbjOHZCySQrWssxSrPN5+O47yWZnE/aDbnb0iuzDATXjD3JUNN yqBzpc1aEpNgYE73IAREmDkc0a32hr0SQHrQ1semo7zrrfNRbhkP9U1KkNtjPkuIxG9k 04sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y09a2vq5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si2264491plh.192.2021.04.09.01.36.33; Fri, 09 Apr 2021 01:36:45 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y09a2vq5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbhDIIds (ORCPT + 99 others); Fri, 9 Apr 2021 04:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhDIIds (ORCPT ); Fri, 9 Apr 2021 04:33:48 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07562C061760; Fri, 9 Apr 2021 01:33:36 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id g10so2385856plt.8; Fri, 09 Apr 2021 01:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lhOBDBWPuZntGK3npBwjF9tJqRpBOuEpoer/aWNxmFg=; b=Y09a2vq5mi2ZQYJlThD9RajGH/diYLOUtR9/xQX9U6SUCPqK/wxCnztrk1v1pVZc1D hrywet7txJlRvP6lniJr6q0VCRHENY9oeNCzfGAq0RVJ1PCUsEDBCGOHmeJ4gCDjI11h eXfZ5l7hBvmobuurXnmZjqRrz/ZF+JIgqYTlOWas12GjeWZ7hvM8eGGsHp4IMjkrHAFC IAOYYBt9lZU+jPIe/Jvpo7voYvaOhCFE+OJjf9l7iryfgU2YhRKsA+IF56ObAE39MDxG je+9ygXL7x7/8TxO4V/t292rOp9fcb+BIf/q+jpWftS6vD+R+hUWhh87hoBH2BXgdspD y87g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lhOBDBWPuZntGK3npBwjF9tJqRpBOuEpoer/aWNxmFg=; b=V0jZyZE+kQ7Bec6MVip/Su5NX/tZD9MCsR/R+zfLHj8lSSV1y55BYXkOSb8kN7Gnu8 El8syMBtpfk28+aQw+fbT53jdiDBuK0XEvEVxhSliZQGvxqpEPKDnY5tnvryTQnFXgjc sbjPR2EogtmIf1/5tgd1R5js0MU9IvxfeLY14mXHDeFD7uUV+UumNI+OdW+xWpNumCII IW6x6VNRG583E685KB4wu8aWjNXkR8/CX9og7uFRmyuB6padnNFD47cpjHbGcghiMDdT KI0om5Wsp5ufSBP2Azy65Con/EEiqKqIOEiFN0Wsyn0xfd5XqLA1oFgExZm71eDgb86E 368g== X-Gm-Message-State: AOAM53096G4l6II+HtYZU87Nb2zw5dtzxHgsktF5lc8Yiy5GXx3AIWBZ VlCsRoFbc/LGWDrkG+klxgHqZb4keKqV10zODkI= X-Received: by 2002:a17:903:22c7:b029:e6:faf5:eb3a with SMTP id y7-20020a17090322c7b02900e6faf5eb3amr11970063plg.23.1617957215608; Fri, 09 Apr 2021 01:33:35 -0700 (PDT) MIME-Version: 1.0 References: <20210409073046.GI3697@techsingularity.net> In-Reply-To: <20210409073046.GI3697@techsingularity.net> From: Xie He Date: Fri, 9 Apr 2021 01:33:24 -0700 Message-ID: Subject: Re: Problem in pfmemalloc skb handling in net/core/dev.c To: Mel Gorman 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.