Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940135AbcKOH23 (ORCPT ); Tue, 15 Nov 2016 02:28:29 -0500 Received: from mgwkm03.jp.fujitsu.com ([202.219.69.170]:51790 "EHLO mgwkm03.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755542AbcKOH2N (ORCPT ); Tue, 15 Nov 2016 02:28:13 -0500 X-Greylist: delayed 671 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2016 02:28:12 EST X-SecurityPolicyCheck: OK by SHieldMailChecker v2.2.3 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20140219-2 From: Takao Indoh To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin CC: Subject: [PATCH] perf/ring_buffer: Fix invalid page order Date: Tue, 15 Nov 2016 16:15:59 +0900 Message-ID: <20161115071559.3756-1-indou.takao@jp.fujitsu.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 Content-Type: text/plain X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 27 In rb_alloc_aux_page(), a page order is set to MAX_ORDER when order is greater than MAX_ORDER, but page order should be less than MAX_ORDER, therefore alloc_pages_node fails at least once. This patch fixes page order so that it can be always less than MAX_ORDER. Signed-off-by: Takao Indoh --- kernel/events/ring_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index 257fa46..3f76fdd 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -502,8 +502,8 @@ static struct page *rb_alloc_aux_page(int node, int order) { struct page *page; - if (order > MAX_ORDER) - order = MAX_ORDER; + if (order >= MAX_ORDER) + order = MAX_ORDER - 1; do { page = alloc_pages_node(node, PERF_AUX_GFP, order); -- 1.8.3.1