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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 A6DD6C433E0 for ; Wed, 3 Mar 2021 14:42:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0CB7F64EED for ; Wed, 3 Mar 2021 14:42:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CB7F64EED Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 356698D0170; Wed, 3 Mar 2021 09:42:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3070A8D0157; Wed, 3 Mar 2021 09:42:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A73C8D0170; Wed, 3 Mar 2021 09:42:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id F3ECA8D0157 for ; Wed, 3 Mar 2021 09:42:34 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 98052824999B for ; Wed, 3 Mar 2021 14:42:34 +0000 (UTC) X-FDA: 77878829028.24.77373EC Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by imf23.hostedemail.com (Postfix) with ESMTP id 14CDDA0049C1 for ; Wed, 3 Mar 2021 14:42:25 +0000 (UTC) Received: by mail-lf1-f54.google.com with SMTP id f1so37494053lfu.3 for ; Wed, 03 Mar 2021 06:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SJyFsTiCe9XNG8TmQw4FTErWPKkRCrfm1UpjfacnCRk=; b=TTTSuCmDYQAQDBRD4EKHRAK1Jd/bFDLZfJoRLYmjth5/oqd2f1BLLm/a1BthSC7wZN L7nUY9xFGKH2u4iFMHMLCu1bB1zy2C/BIhGsLIlvsWX1Z2bKNlChUy1EtdqTINFc1IXe 7J/Yc1MGbaBDwUiWj4WYa+c8E+D75k6FHy+RGqPIrN3iUm2LRKyaSsr+K82CAT0/oKMY iuCQe4GNkqOAVOKidqaiLcNSFPr+k+TCrqyBOSovDARkfFYe8iJyO1gpLy2gZH8dHJPl R3LfIpycj6qZnIqU8tINI41bUp/uu7NT9YlK1D5N8frx8Z3XvCbIGq4zuk/aPAUEIJUT hqtw== 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=SJyFsTiCe9XNG8TmQw4FTErWPKkRCrfm1UpjfacnCRk=; b=uD8Mymm4GzDjUjnpMu2+HOY9UjEDdjfQMnGhq0kkagPpTPqQy/ieGIFzRex6lijg+i xu3AKuwRf+DdhKBtaaPeozdXn+GfF6tRRYMMTX9Iu6ik6cBItcHTyWMikKuXsnci+6ig CvBgeTRyYPY9XPQWQDLgrbRGy67/fstxQmuc2/Quykoivd+llbqgUdMXGmcXXUzOZ33+ jkSFcaeNJJMDCbFwIjJewQgDXaWGBd8r1oY/wLxv/hssYbAzapw/XoE/tKlWD+ucT//P mGQBEtkq6YHXbwA4UYkfDjNixRbzLr1VRebpSC8b0gu3PNy+iDwPgA9zJPlDPWiwME45 +mxQ== X-Gm-Message-State: AOAM532PVdgvUVflend61iSaaGbV6Os1uSPhqTUABZ0EQY30FXWxLibP ni2vJDMRHaJ0+tOXljGqbWdbnT4GWFECLkGqOdh8eA== X-Google-Smtp-Source: ABdhPJzvKP5lgHp/eRliXv3scmLxOVHbfjwzKOI4TpEoH0afRBOD8JAccayavUGKnE30nEG4RNc9dL19sFT2ScAagy0= X-Received: by 2002:a05:6512:942:: with SMTP id u2mr15752552lft.117.1614782544239; Wed, 03 Mar 2021 06:42:24 -0800 (PST) MIME-Version: 1.0 References: <20210303093956.72318-1-songmuchun@bytedance.com> In-Reply-To: From: Shakeel Butt Date: Wed, 3 Mar 2021 06:42:11 -0800 Message-ID: Subject: Re: [External] Re: [PATCH v2] mm: memcontrol: fix kernel stack account To: Michal Hocko Cc: Muchun Song , Roman Gushchin , Johannes Weiner , Andrew Morton , LKML , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: q9ged7jbiwckyrcc1op35skhohtqdqxw X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 14CDDA0049C1 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=mail-lf1-f54.google.com; client-ip=209.85.167.54 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614782545-993196 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 3, 2021 at 6:02 AM Michal Hocko wrote: > [...] > > > > + BUG_ON(vm->nr_pages != THREAD_SIZE / PAGE_SIZE); > > > > > > I do not think we need this BUG_ON. What kind of purpose does it serve? > > > > vm->nr_pages should be always equal to THREAD_SIZE / PAGE_SIZE > > if the system is not corrupted. > > BUG_ON is not an annotation for "this shouldn't happen". Even if the > system was corrupted and nr_pages wouldn't match then this is not a > reason to crash the kernel right away. > > In general there should be a very _strong_ reason to add a BUG_ON. > I agree with Michal. We should remove this BUG_ON or at least convert it into VM_BUG_ON.