Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2632821imm; Fri, 20 Jul 2018 02:01:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdCkjjawTw/Uk66ziYqVLTwI9NfthbS0tmeDuKzyjrgcEmkQIPYklBZTYjYrmso/7nMI7W9 X-Received: by 2002:a17:902:a716:: with SMTP id w22-v6mr1238287plq.271.1532077298942; Fri, 20 Jul 2018 02:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532077298; cv=none; d=google.com; s=arc-20160816; b=Jn6loPCLhZoF5QXHMHc+iCSob5d6TUmfwo72wkZHP0WLRDghvkLVt7i9ZZge1y/0lP 2Vv8CFT1tdjZHtT4TdyWFK072nYNYoaG2WoJnYWy8x1s3QCnOHGDOUsVnhaKnih4JZOM sB7396HlFGhCDvZXbOp4iZdapU0G26BfijWEXFhISCN0E8cVL5HhPbJh/NEskTDhaHek FU81XCP3YZfVN+YDXxy2Qn1o6G9oCoX/lQNKBZq2w3B/J9rUk3lHSc8n48J2fmTmH2P4 v4GjovBpCU00RAHnMiQ3vLR4PfqeOwKNHT7McM4FmmcfmRvi1gAaSXZzChhinRpdqrv2 7J/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=It6i2W18pu8vLxlFmfGv1XDNyc0sX4gOgxm0WiAEkGk=; b=U7cDTnaQ1LcGl/4lAhM3ieoejv1gNyq1IoS6LPtuNgzfzyXE5dzxeMcjQw9jzohQaz 7oe+zr1SdO29E0L91LYSGjvI0pvmAegMfpLXYQuEENueK3diny0J6LR5TxvUiDity0VG Aymd2LbE+bfyrxdMV0z2fPO6mtAoVy7ztkqi4sIS8yNOzDt4rXi35dgjaLnK/wRdY582 vwQMXKouB9x148+pIkDQdXkZEawRoks6dHA56B5mWnaLY1qKwn8jGMUmBJdc7dSBiyZI wuCHBQH7z9S9o0gdkWQbl1fnt+qRRXAV7mMMnu9mHs9J7QNriGigZnWXApHuO4oPG609 3zew== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t190-v6si1365120pfb.216.2018.07.20.02.01.24; Fri, 20 Jul 2018 02:01: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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727884AbeGTJrz (ORCPT + 99 others); Fri, 20 Jul 2018 05:47:55 -0400 Received: from mga12.intel.com ([192.55.52.136]:18474 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbeGTJrz (ORCPT ); Fri, 20 Jul 2018 05:47:55 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2018 02:00:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,378,1526367600"; d="scan'208";a="66141362" Received: from devel-ww.sh.intel.com ([10.239.48.110]) by FMSMGA003.fm.intel.com with ESMTP; 20 Jul 2018 02:00:32 -0700 From: Wei Wang To: virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-mm@kvack.org, mst@redhat.com, mhocko@kernel.org, akpm@linux-foundation.org, torvalds@linux-foundation.org Cc: pbonzini@redhat.com, wei.w.wang@intel.com, liliang.opensource@gmail.com, yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com, peterx@redhat.com Subject: [PATCH v36 4/5] mm/page_poison: expose page_poisoning_enabled to kernel modules Date: Fri, 20 Jul 2018 16:33:04 +0800 Message-Id: <1532075585-39067-5-git-send-email-wei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532075585-39067-1-git-send-email-wei.w.wang@intel.com> References: <1532075585-39067-1-git-send-email-wei.w.wang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang Cc: Andrew Morton Cc: Michal Hocko Cc: Michael S. Tsirkin Acked-by: Andrew Morton --- mm/page_poison.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/page_poison.c b/mm/page_poison.c index aa2b3d3..830f604 100644 --- a/mm/page_poison.c +++ b/mm/page_poison.c @@ -17,6 +17,11 @@ static int __init early_page_poison_param(char *buf) } early_param("page_poison", early_page_poison_param); +/** + * page_poisoning_enabled - check if page poisoning is enabled + * + * Return true if page poisoning is enabled, or false if not. + */ bool page_poisoning_enabled(void) { /* @@ -29,6 +34,7 @@ bool page_poisoning_enabled(void) (!IS_ENABLED(CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC) && debug_pagealloc_enabled())); } +EXPORT_SYMBOL_GPL(page_poisoning_enabled); static void poison_page(struct page *page) { -- 2.7.4