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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 28E84C4740A for ; Mon, 9 Sep 2019 18:01:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F06422086D for ; Mon, 9 Sep 2019 18:01:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391522AbfIISBG (ORCPT ); Mon, 9 Sep 2019 14:01:06 -0400 Received: from mga02.intel.com ([134.134.136.20]:23280 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391382AbfIISBF (ORCPT ); Mon, 9 Sep 2019 14:01:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 11:01:05 -0700 X-IronPort-AV: E=Sophos;i="5.64,486,1559545200"; d="scan'208";a="196273339" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 11:01:05 -0700 Message-ID: Subject: Re: [PATCH v9 3/8] mm: Move set/get_pcppage_migratetype to mmzone.h From: Alexander Duyck To: "Kirill A. Shutemov" , Alexander Duyck Cc: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, mst@redhat.com, catalin.marinas@arm.com, david@redhat.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, willy@infradead.org, mhocko@kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, will@kernel.org, linux-arm-kernel@lists.infradead.org, osalvador@suse.de, yang.zhang.wz@gmail.com, pagupta@redhat.com, konrad.wilk@oracle.com, nitesh@redhat.com, riel@surriel.com, lcapitulino@redhat.com, wei.w.wang@intel.com, aarcange@redhat.com, ying.huang@intel.com, pbonzini@redhat.com, dan.j.williams@intel.com, fengguang.wu@intel.com, kirill.shutemov@linux.intel.com Date: Mon, 09 Sep 2019 11:01:04 -0700 In-Reply-To: <20190909095608.jwachx3womhqmjbl@box> References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190907172528.10910.37051.stgit@localhost.localdomain> <20190909095608.jwachx3womhqmjbl@box> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-09-09 at 12:56 +0300, Kirill A. Shutemov wrote: > On Sat, Sep 07, 2019 at 10:25:28AM -0700, Alexander Duyck wrote: > > From: Alexander Duyck > > > > In order to support page reporting it will be necessary to store and > > retrieve the migratetype of a page. To enable that I am moving the set and > > get operations for pcppage_migratetype into the mm/internal.h header so > > that they can be used outside of the page_alloc.c file. > > > > Reviewed-by: Dan Williams > > Signed-off-by: Alexander Duyck > > I'm not sure that it's great idea to export this functionality beyond > mm/page_alloc.c without any additional safeguards. How would we avoid to > messing with ->index when the page is not in the right state of its > life-cycle. Can we add some VM_BUG_ON()s here? I am not sure what we would need to check on though. There are essentially 2 cases where we are using this. The first is the percpu page lists so the value is set either as a result of __rmqueue_smallest or free_unref_page_prepare. The second one which hasn't been added yet is for the Reported pages case which I add with patch 6. When I use it for page reporting I am essentially using the Reported flag to identify what pages in the buddy list will have this value set versus those that may not. I didn't explicitly define it that way, but that is how I am using it so that the value cannot be trusted unless the Reported flag is set. 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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 DABC3C4740C for ; Mon, 9 Sep 2019 18:01:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AFA2E2086D for ; Mon, 9 Sep 2019 18:01:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFA2E2086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 47A306B0005; Mon, 9 Sep 2019 14:01:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 429F66B0006; Mon, 9 Sep 2019 14:01:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 318666B0007; Mon, 9 Sep 2019 14:01:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id 1448B6B0005 for ; Mon, 9 Sep 2019 14:01:08 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id B0FB9BEF6 for ; Mon, 9 Sep 2019 18:01:07 +0000 (UTC) X-FDA: 75916148574.18.head25_9c1db613b53e X-HE-Tag: head25_9c1db613b53e X-Filterd-Recvd-Size: 3583 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Sep 2019 18:01:06 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 11:01:05 -0700 X-IronPort-AV: E=Sophos;i="5.64,486,1559545200"; d="scan'208";a="196273339" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 11:01:05 -0700 Message-ID: Subject: Re: [PATCH v9 3/8] mm: Move set/get_pcppage_migratetype to mmzone.h From: Alexander Duyck To: "Kirill A. Shutemov" , Alexander Duyck Cc: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, mst@redhat.com, catalin.marinas@arm.com, david@redhat.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, willy@infradead.org, mhocko@kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, will@kernel.org, linux-arm-kernel@lists.infradead.org, osalvador@suse.de, yang.zhang.wz@gmail.com, pagupta@redhat.com, konrad.wilk@oracle.com, nitesh@redhat.com, riel@surriel.com, lcapitulino@redhat.com, wei.w.wang@intel.com, aarcange@redhat.com, ying.huang@intel.com, pbonzini@redhat.com, dan.j.williams@intel.com, fengguang.wu@intel.com, kirill.shutemov@linux.intel.com Date: Mon, 09 Sep 2019 11:01:04 -0700 In-Reply-To: <20190909095608.jwachx3womhqmjbl@box> References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190907172528.10910.37051.stgit@localhost.localdomain> <20190909095608.jwachx3womhqmjbl@box> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Mon, 2019-09-09 at 12:56 +0300, Kirill A. Shutemov wrote: > On Sat, Sep 07, 2019 at 10:25:28AM -0700, Alexander Duyck wrote: > > From: Alexander Duyck > > > > In order to support page reporting it will be necessary to store and > > retrieve the migratetype of a page. To enable that I am moving the set and > > get operations for pcppage_migratetype into the mm/internal.h header so > > that they can be used outside of the page_alloc.c file. > > > > Reviewed-by: Dan Williams > > Signed-off-by: Alexander Duyck > > I'm not sure that it's great idea to export this functionality beyond > mm/page_alloc.c without any additional safeguards. How would we avoid to > messing with ->index when the page is not in the right state of its > life-cycle. Can we add some VM_BUG_ON()s here? I am not sure what we would need to check on though. There are essentially 2 cases where we are using this. The first is the percpu page lists so the value is set either as a result of __rmqueue_smallest or free_unref_page_prepare. The second one which hasn't been added yet is for the Reported pages case which I add with patch 6. When I use it for page reporting I am essentially using the Reported flag to identify what pages in the buddy list will have this value set versus those that may not. I didn't explicitly define it that way, but that is how I am using it so that the value cannot be trusted unless the Reported flag is set. 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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3D26EC4740A for ; Mon, 9 Sep 2019 18:01:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 167EA2086D for ; Mon, 9 Sep 2019 18:01:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PGPj/JzT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 167EA2086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=re89XcphihZtw44Vt1631zifaMwRtahRY+OSiH/Lg+0=; b=PGPj/JzTSM7RwI C8wk74dlbpXdkNtqlTZ6pDdGeWiKMfm6NC+MuqcICkflH7BJxXc3x5WQ5/lQUqWwsFKS3xED476zR jAu/qviK4UMD1Di3zh+la5HbZvtyWTPkSJD4mTZiBUQKOQ1f0U5lgo3bPuJmUKH7NbXj6BrHbkVQ8 lmZhbAb0cev2UTnGemjgvf1ing2ve5hl0dWTChm851CHCOH2a6IlKH/3enUnsAGabO39Zp0tuhLc0 rMUWrepYqsPeA5QsSkLLxBgHHG0RaFc7Num7f/oDZrsYMMBtujNk5tnGEr1GLfAPL5bsveepugTh+ uPFhq5pA1ThLYbzVP9UA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i7NyO-0004Lm-7K; Mon, 09 Sep 2019 18:01:08 +0000 Received: from mga06.intel.com ([134.134.136.31]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i7NyM-0004L8-7e for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2019 18:01:07 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 11:01:05 -0700 X-IronPort-AV: E=Sophos;i="5.64,486,1559545200"; d="scan'208";a="196273339" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 11:01:05 -0700 Message-ID: Subject: Re: [PATCH v9 3/8] mm: Move set/get_pcppage_migratetype to mmzone.h From: Alexander Duyck To: "Kirill A. Shutemov" , Alexander Duyck Date: Mon, 09 Sep 2019 11:01:04 -0700 In-Reply-To: <20190909095608.jwachx3womhqmjbl@box> References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190907172528.10910.37051.stgit@localhost.localdomain> <20190909095608.jwachx3womhqmjbl@box> User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190909_110106_319825_6F656D93 X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.zhang.wz@gmail.com, pagupta@redhat.com, kvm@vger.kernel.org, david@redhat.com, catalin.marinas@arm.com, mhocko@kernel.org, linux-mm@kvack.org, will@kernel.org, aarcange@redhat.com, virtio-dev@lists.oasis-open.org, mst@redhat.com, willy@infradead.org, wei.w.wang@intel.com, ying.huang@intel.com, riel@surriel.com, dan.j.williams@intel.com, lcapitulino@redhat.com, linux-arm-kernel@lists.infradead.org, osalvador@suse.de, nitesh@redhat.com, konrad.wilk@oracle.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, pbonzini@redhat.com, akpm@linux-foundation.org, fengguang.wu@intel.com, kirill.shutemov@linux.intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2019-09-09 at 12:56 +0300, Kirill A. Shutemov wrote: > On Sat, Sep 07, 2019 at 10:25:28AM -0700, Alexander Duyck wrote: > > From: Alexander Duyck > > > > In order to support page reporting it will be necessary to store and > > retrieve the migratetype of a page. To enable that I am moving the set and > > get operations for pcppage_migratetype into the mm/internal.h header so > > that they can be used outside of the page_alloc.c file. > > > > Reviewed-by: Dan Williams > > Signed-off-by: Alexander Duyck > > I'm not sure that it's great idea to export this functionality beyond > mm/page_alloc.c without any additional safeguards. How would we avoid to > messing with ->index when the page is not in the right state of its > life-cycle. Can we add some VM_BUG_ON()s here? I am not sure what we would need to check on though. There are essentially 2 cases where we are using this. The first is the percpu page lists so the value is set either as a result of __rmqueue_smallest or free_unref_page_prepare. The second one which hasn't been added yet is for the Reported pages case which I add with patch 6. When I use it for page reporting I am essentially using the Reported flag to identify what pages in the buddy list will have this value set versus those that may not. I didn't explicitly define it that way, but that is how I am using it so that the value cannot be trusted unless the Reported flag is set. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-6094-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 65F869844EC for ; Mon, 9 Sep 2019 18:01:07 +0000 (UTC) Message-ID: From: Alexander Duyck Date: Mon, 09 Sep 2019 11:01:04 -0700 In-Reply-To: <20190909095608.jwachx3womhqmjbl@box> References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190907172528.10910.37051.stgit@localhost.localdomain> <20190909095608.jwachx3womhqmjbl@box> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [virtio-dev] Re: [PATCH v9 3/8] mm: Move set/get_pcppage_migratetype to mmzone.h To: "Kirill A. Shutemov" , Alexander Duyck Cc: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, mst@redhat.com, catalin.marinas@arm.com, david@redhat.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, willy@infradead.org, mhocko@kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, will@kernel.org, linux-arm-kernel@lists.infradead.org, osalvador@suse.de, yang.zhang.wz@gmail.com, pagupta@redhat.com, konrad.wilk@oracle.com, nitesh@redhat.com, riel@surriel.com, lcapitulino@redhat.com, wei.w.wang@intel.com, aarcange@redhat.com, ying.huang@intel.com, pbonzini@redhat.com, dan.j.williams@intel.com, fengguang.wu@intel.com, kirill.shutemov@linux.intel.com List-ID: On Mon, 2019-09-09 at 12:56 +0300, Kirill A. Shutemov wrote: > On Sat, Sep 07, 2019 at 10:25:28AM -0700, Alexander Duyck wrote: > > From: Alexander Duyck > > > > In order to support page reporting it will be necessary to store and > > retrieve the migratetype of a page. To enable that I am moving the set and > > get operations for pcppage_migratetype into the mm/internal.h header so > > that they can be used outside of the page_alloc.c file. > > > > Reviewed-by: Dan Williams > > Signed-off-by: Alexander Duyck > > I'm not sure that it's great idea to export this functionality beyond > mm/page_alloc.c without any additional safeguards. How would we avoid to > messing with ->index when the page is not in the right state of its > life-cycle. Can we add some VM_BUG_ON()s here? I am not sure what we would need to check on though. There are essentially 2 cases where we are using this. The first is the percpu page lists so the value is set either as a result of __rmqueue_smallest or free_unref_page_prepare. The second one which hasn't been added yet is for the Reported pages case which I add with patch 6. When I use it for page reporting I am essentially using the Reported flag to identify what pages in the buddy list will have this value set versus those that may not. I didn't explicitly define it that way, but that is how I am using it so that the value cannot be trusted unless the Reported flag is set. --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org