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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 584FBC433B4 for ; Fri, 9 Apr 2021 10:15:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33FDC610A7 for ; Fri, 9 Apr 2021 10:15:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234173AbhDIKPt (ORCPT ); Fri, 9 Apr 2021 06:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234717AbhDIKPM (ORCPT ); Fri, 9 Apr 2021 06:15:12 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1C3C061765; Fri, 9 Apr 2021 03:14:11 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id d5-20020a17090a2a45b029014d934553c4so3736699pjg.1; Fri, 09 Apr 2021 03:14:11 -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=YOBY+nGJ0NSe8Za1C4NDeG65/7cWv3y7G0rLV+xs2sQ=; b=E9a+9aKUqNdSjhLgrcBU5Veiwk1IQh45MTtCR3aauVhtQUxiD8rU+RIuWYqtZjVBPX SHdcq05gt3BqMF7dOX0mTYKQnCAN048TIC+O96QoeROKd1feVe+ckBOIleXgtwhDllVV jg6BGNvrsptQmqQGNOujMLbOXoGO25G0BCRs7ySvONNS9IKhfy9DmfejT6JsT5w5h/Pt fzgWM9epserQsy/F65RbEoNFFcJONS0l0KHTwnQauUD1Vu7pdo6SpMGk1WYgjeeWRx4u IwUh4pYBv01Hxcg5WgVWnfAgZoocLuL2L7FuQUkFcXFlBRBtNGKSZhry0w/W0YS82ZYR /fdw== 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=YOBY+nGJ0NSe8Za1C4NDeG65/7cWv3y7G0rLV+xs2sQ=; b=VyZgYsk6vTtsAzwPqyeQBcZpgr8HJELjHTYY2QJ/2a4PlaO86GxA7GqjrK/Gndbim9 T2XiD4NA29DTbNsCMj4Gj/eDT6bAfZo/rjNDid8rr4M+RRfmpgK37T46jPGrTky1jOuI gcSa1gAIiDPj1/0cbMsAeZd3clQ1exXzsXkyHluRDGDWapOABGRDQPMiZrqHKC0vRMro JcHKgyJZ61H76OqyGhnT7+pw1irFJqNxmJpfI2bB0uujxNVdgvVVhzZZ7GzBmIAOng4a NwPD/C/I3Q34xTFv7GVhfgBrW9Pm6omOdqgf07OkrxUor0ryS4NcK/McVFoNokJdoJbD 29/A== X-Gm-Message-State: AOAM533ursXxYfqrSYZt57l3LbFnqMg2mPriufQJ3E5nl8unfgsBBzGn 7ufA8Mj3TUELyqP8EMw7R1tRB8n3RKPRp4palqU= X-Google-Smtp-Source: ABdhPJzrCE9HvBQl4/X83laizRRPqiS3VhqmtRHN+JqA4mFaXaaQ3uyPmWbixzJjFsfydz01nFNQwbEMgYazvpCcJ6c= X-Received: by 2002:a17:90b:400a:: with SMTP id ie10mr4205591pjb.210.1617963251043; Fri, 09 Apr 2021 03:14:11 -0700 (PDT) MIME-Version: 1.0 References: <20210409073046.GI3697@techsingularity.net> <20210409084436.GK3697@techsingularity.net> <87ab3d13-f95d-07c5-fc6a-fb33e32685e5@gmail.com> In-Reply-To: <87ab3d13-f95d-07c5-fc6a-fb33e32685e5@gmail.com> From: Xie He Date: Fri, 9 Apr 2021 03:14:00 -0700 Message-ID: Subject: Re: Problem in pfmemalloc skb handling in net/core/dev.c To: Eric Dumazet Cc: Mel Gorman , Mel Gorman , jslaby@suse.cz, Neil Brown , Peter Zijlstra , Mike Christie , Eric B Munson , 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: netdev@vger.kernel.org On Fri, Apr 9, 2021 at 3:04 AM Eric Dumazet wrote: > > Note that pfmemalloc skbs are normally dropped in sk_filter_trim_cap() > > Simply make sure your protocol use it. It seems "sk_filter_trim_cap" needs an "struct sock" argument. Some of my protocols act like a middle layer to another protocol and don't have any "struct sock". Also, I think this is a problem in net/core/dev.c, there are a lot of old protocols that are not aware of pfmemalloc skbs. I don't think it's a good idea to fix them one by one.