Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1225717pxf; Fri, 9 Apr 2021 03:17:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyfYZf3jqG/upu/fWnYX1iXeRJOSIfB1ul1Fl0Xh+9URFWU/KROKkd6hfEOk0fEFC7gpNL X-Received: by 2002:a17:90b:4c87:: with SMTP id my7mr13112826pjb.162.1617963456082; Fri, 09 Apr 2021 03:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617963456; cv=none; d=google.com; s=arc-20160816; b=bOqbEdu56fvm5Z6ca1YaULDumcQ88j8tPXIv/C9tfyT3TvNykFQoWIqQ5la9UxV1/f oGRGadKckhXdYg+CnaVBlE9hmn3lRDI4tNQxqcGqeMgKqpd7YAwmn3Y7qZDvDO9G7ce/ iC8XbVybitzLGWCzByVtdAmdvEM8yYmfLNqE+WTnrsueewBRrBGl1wd/3CDZRmqVak7p id80AWxaGTGi636ZieghftGhghRb7LdBUxdYWE1UtFDK6QNM2rTK+AgHBQfTMGk+lb7p u9HjFB/tX5S8tqdV5fkXYMjE5Agp1E4mKV3F8js3++3aho+2GdSkX3jDadbm6H1JM98d WV2A== 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=YOBY+nGJ0NSe8Za1C4NDeG65/7cWv3y7G0rLV+xs2sQ=; b=KqOx60EBhWwSvlpz56cJsYrQwEWN6rtbQtOpFVHP4mibLiw+1J44ES0cGj1BPUYnoI PsvfQp8ThS+x6lJHH9NuB6S85GX7gk8k4izxCegu5CQxJCdWunbVWVIMfcplG1QomVeL hOE8PAIanKK++bDO/ZSPah5kiMzRLFrMHvTcBA4I7qmFp9Ym/EwFSuI2hkLHHtspJmYG dz3+5dJGpfnF62YdgHlmvp4oFdT/iTiTOx5SndwE1waTVX/htsmE5R4+ESq7aOY5DxSP PiAZTM1U3a3KsHFD5J6TK/zMO3GZDKBcV/amB51IN0imUgdF6HVcUyqJaLDt3tthgiF3 Iisw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E9a+9aKU; 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 d2si938247pfv.288.2021.04.09.03.17.23; Fri, 09 Apr 2021 03:17:36 -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=E9a+9aKU; 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 S233936AbhDIKQz (ORCPT + 99 others); Fri, 9 Apr 2021 06:16:55 -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-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: linux-kernel@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.