From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756405AbbKEU4c (ORCPT ); Thu, 5 Nov 2015 15:56:32 -0500 Received: from shelob.surriel.com ([74.92.59.67]:60047 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbbKEU43 (ORCPT ); Thu, 5 Nov 2015 15:56:29 -0500 From: riel@redhat.com To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@kernel.org, jstancek@redhat.com, mgorman@suse.de Subject: [PATCH 0/2] sched,numa: cap pte scanning overhead to 3% of run time Date: Thu, 5 Nov 2015 15:56:21 -0500 Message-Id: <1446756983-28173-1-git-send-email-riel@redhat.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jan Stancek identified an LTP stress test causing trouble with the NUMA balancing code. The test forks off enough 3GB sized tasks to fill up 80% of system memory on a system with 12TB RAM. That results in over 2000 tasks allocating and touching memory simultaneously. The NUMA balancing code causes each task to scan a certain number of PTEs every 10ms. Due to the large number of tasks on the system, and the large amount of memory in each process, it may take 10ms for each task to finish its PTE scan. Meanwhile, the NUMA code only tries to ensure each task has used a few (2-3) ms of CPU time in-between invocations of task_numa_work. On a system that overloaded, we end up spending essentially all of our CPU time in task_numa_work, and the tasks make very little progress. Allocating all the memory can take several hours. With these patches, the CPU time spent in task_numa_work is limited to around 3% of run time, and the test case completes in minutes.