Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754155AbdGYTih (ORCPT ); Tue, 25 Jul 2017 15:38:37 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:38075 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbdGYTif (ORCPT ); Tue, 25 Jul 2017 15:38:35 -0400 Date: Tue, 25 Jul 2017 15:38:33 -0400 From: Josef Bacik To: Dennis Zhou Cc: Tejun Heo , Christoph Lameter , Josef Bacik , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@fb.com, Dennis Zhou Subject: Re: [PATCH v2 20/23] percpu: update free path to take advantage of contig hints Message-ID: <20170725193832.GT18880@destiny> References: <20170724230220.21774-1-dennisz@fb.com> <20170724230220.21774-21-dennisz@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170724230220.21774-21-dennisz@fb.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1385 Lines: 31 On Mon, Jul 24, 2017 at 07:02:17PM -0400, Dennis Zhou wrote: > From: "Dennis Zhou (Facebook)" > > The bitmap allocator must keep metadata consistent. The easiest way is > to scan after every allocation for each affected block and the entire > chunk. This is rather expensive. > > The free path can take advantage of current contig hints to prevent > scanning within the start and end block. If a scan is needed, it can > be done by scanning backwards from the start and forwards from the end > to identify the entire free area this can be combined with. The blocks > can then be updated by some basic checks rather than complete block > scans. > > A chunk scan happens when the freed area makes a page free, a block > free, or spans across blocks. This is necessary as the contig hint at > this point could span across blocks. The check uses the minimum of page > size and the block size to allow for variable sized blocks. There is a > tradeoff here with not updating after every free. It is possible a > contig hint in one block can be merged with the contig hint in the next > block. This means the contig hint can be off by up to a page. However, > if the chunk's contig hint is contained in one block, the contig hint > will be accurate. > > Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Thanks, Josef