Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2200602imm; Mon, 16 Jul 2018 04:09:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpePJGYe3S5e/mJxbeA+BMOP3dtr2Fe/FDIWWsbtJ23tQsrtbGAox2/+AZthkJYtQ6NucKEi X-Received: by 2002:a63:d80f:: with SMTP id b15-v6mr15328548pgh.347.1531739378039; Mon, 16 Jul 2018 04:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531739378; cv=none; d=google.com; s=arc-20160816; b=Y0AK3TnA6FGGRpVJYCjek+IPa3hDftCyfjPnnIUfrnB8Mx3TzCTy5iRruR5PGX2gq2 /Lb0Wdvn4fk+GAu3qieluWjOmmb1Ms3Bu0mJsfGLhSh7+5Ivq7j0jvJ7jOaPtMRHDgSc zsOv1i8BcfqA0NnvaHV/4BhsF7PPAIj3hgfd9/y/AIPfszR5+oPig22KXc7k2VNXgGOb S7PrV53FWh3jlbh3oSf5MOGVTyKTo6USltIUbfBp9aHPGP4tvZD53pYhvRGVI0ET/C1O KGIftW/rpjCxzMw8Ob0GsddoDVJwiugfusKfHCc4O9bUroAf/MXcO+Kkb+Kl6KvHDY6g ol4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3r77yUA7LR6d4xLDZP2mn+84Sl8HTgg9Ve+nPezJG1Y=; b=m1An7zVbhtqZe33v/94KljLsI3fwtBPl5mpQlitKVeic4/l6FEmjoZ4kSnxwNwo5xK jMV9EogOmSa+v90o9KwPor+VOUPZQRtCcLsvubT4850adXt3zk0HMakwbyEo/SQtgcNa H3+oX0C8KRSNDv8/jMnD73q+Cl7LpAeTg3HpIk8wijDm8h+n/q1A/1z67zZdpeCl8i7d yS2K1nlGmHp8t802bR0t30AYkhS6/MQGvdPCob970mfqmTt8nkM5Lwr0eK5+veLm6Xy1 Sjl4rBX5PKlr+RPGVODja6RUe7qU1VOTjlCkcAVvK447bBp+NaDD9TxYIlKG+4BMDOtJ xr4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si30728729plv.16.2018.07.16.04.09.22; Mon, 16 Jul 2018 04:09:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbeGPLfl (ORCPT + 99 others); Mon, 16 Jul 2018 07:35:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:49506 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727953AbeGPLfl (ORCPT ); Mon, 16 Jul 2018 07:35:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E80FFADC2; Mon, 16 Jul 2018 11:08:45 +0000 (UTC) Date: Mon, 16 Jul 2018 13:08:45 +0200 From: Michal Hocko To: Yafang Shao Cc: Johannes Weiner , Vladimir Davydov , Cgroups , Linux MM , LKML Subject: Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq Message-ID: <20180716110845.GK17280@dhcp22.suse.cz> References: <1531557122-12540-1-git-send-email-laoar.shao@gmail.com> <20180716075836.GC17280@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 16-07-18 17:45:06, Yafang Shao wrote: > On Mon, Jul 16, 2018 at 3:58 PM, Michal Hocko wrote: > > On Sat 14-07-18 16:32:02, Yafang Shao wrote: > >> try_charge maybe executed in packet receive path, which is in interrupt > >> context. > >> In this situation, the 'current' is the interrupted task, which may has > >> no relation to the rx softirq, So it is nonsense to use 'current'. > >> > >> Avoid bothering the interrupted if page_counter_try_charge failes. > > > > I agree with Shakeel that this changelog asks for more information about > > "why it matters". Small inconsistencies should be tolerable because the > > state we rely on is so rarely set that it shouldn't make a visible > > difference in practice. > > > > HI Michal, > > No, it can make a visible difference in pratice. > The difference is in __sk_mem_raise_allocated(). > > Without this patch, if the random interrupted task is oom victim or > fatal signal pending or exiting, the charge will success anyway. That > means the cgroup limit doesn't work in this situation. > > With this patch, in the same situation the charged memory will be > uncharged as it hits the memcg limit. > > That is okay if the memcg of the interrupted task is same with the > sk->sk_memcg, but it may not okay if they are difference. > > I'm trying to prove it, but seems it's very hard to produce this issue. So it is possible that this is so marginal that it doesn't make any _practical_ impact after all. -- Michal Hocko SUSE Labs