Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1401564
| Path | csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Michal Hocko <mhocko@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c |
| Date | Mon, 16 May 2016 17:20:02 +0200 |
| Message-ID | <rzstk-df-9@gated-at.bofh.it> (permalink) |
| References | <rzstk-df-11@gated-at.bofh.it> |
| X-Original-To | Wang Xiaoqiang <wang_xiaoq@126.com> |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZfpNu8uiBuZ588+LDx4FVi8eG2EEHp/1lsGEC66TJCM=; b=km2FmxdmSbRG0PuDTMR8RybK1WXT8Pe3AT3UtTGYEY6Iaw3LS4CwYfEPoKTFwwRaeO p3eRw6zO2BhpWUiWiSr1Z7PNDQbKDXOItGu49nI18LYSNX3Z7V0IZrUktNdEgeU1wMDF +lvGTvHQr25ezQIjporSAVuEpRsOOo2ZNIvZehMKmbrqSQ0NLrvaGgncP0ZCydMoxzoP E7DD1TPm25n+kmYC5IyPOIpy9R2891TgfSdXwjBfL/RpEFC4mSr5Y96YU4bK5g7H14K8 I7sk378PrJEh90m06mZHTdkGHzd7Jd7NiHHz0XrKqDLBtoyY8Sw3Nmzsj5cQsi9HyBiw z/gA== |
| X-Gm-Message-State | AOPr4FVlb0Ov1AiHCgmt9m2Kvtx/Hcf3n6Dli8vGG5a4YS9nOH28sfFicqNJcCDYcZzAqw== |
| X-Received | by 10.194.42.69 with SMTP id m5mr30742616wjl.89.1463411818762; Mon, 16 May 2016 08:16:58 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.6.0 (2016-04-01) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 19 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | vbabka@suse.cz, n-horiguchi@ah.jp.nec.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org |
| X-Original-Date | Mon, 16 May 2016 17:16:57 +0200 |
| X-Original-Message-ID | <20160516151657.GC23251@dhcp22.suse.cz> |
| X-Original-References | <7374bd2e.da35.154b9cda7d2.Coremail.wang_xiaoq@126.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1401564 |
Show key headers only | View raw
On Mon 16-05-16 21:42:23, Wang Xiaoqiang wrote: > Hi all, > > I am really confused about these two functions. The following code snippet: > > if(unlikely(atomic_read(&page->_mapcount) != -1)) > bad_reason ="nonzero mapcount";if(unlikely(page->mapping != NULL)) > bad_reason ="non-NULL mapping";if(unlikely(page_ref_count(page) !=0)) > bad_reason ="nonzero _count"; > ... > Wouldn't the previous value of "bad_reason" be overwritten by > the later? Hope to receive from you. yes it would. Why that would matter. The checks should be in an order which could give us a more specific reason with later checks. bad_page() will then print more detailed information. -- Michal Hocko SUSE Labs
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c Michal Hocko <mhocko@kernel.org> - 2016-05-16 17:20 +0200 Re: Question About Functions "__free_pages_check" and "check_new_page" in page_alloc.c Vlastimil Babka <vbabka@suse.cz> - 2016-05-17 07:20 +0200
csiph-web