Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1703218imc; Mon, 11 Mar 2019 21:41:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGgwpJue25wuB53SLij5VAJqGKT6aM78cyjGNnXYy4ulv1QZirWa3qT4K0qK926gkTkZ1T X-Received: by 2002:a17:902:43a4:: with SMTP id j33mr7571318pld.71.1552365661792; Mon, 11 Mar 2019 21:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552365661; cv=none; d=google.com; s=arc-20160816; b=gs+h2k8Yt3tPM/gg+fsVFO5nFabTn1cPsHAZRtETsM1AgdXcW55XI3PBBiHBx5lY7y 1GRw1GT7UnHPewFlhJJYwaacqiAiyX+PL8oN/mwIH+84VItwORJ5VcIXtHsCj6P0BCOl W2O2zi9JEdSP/bxhiUJ1jKBrRauln3XFVsnGgt2nffrlA0ObnbDWZaQU9wQGPczIKiEL XZTB+W6lWOnmemhS/TFPXSkeVA8B/xA7WdC5oP4+rzcg0vCVSuTon9izGObLwgl9rr2K VtI8q5X6mCjV5A1AtA+/vigt3bvMoTcbooBh5V8LWlfBygklPS/wQ2/UuLmx5nNYo2pw AaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=LkhfHT+eZqOj4+XJACRRXYWHTO5hqppA0D2BmcRnPaE=; b=rwZAWeOi0k5DIFGl9fndHVVpu09d1nE2eVJS2tRRirJNIcEKSYqiCAyQxB0nVOtk8g JfwFeNCfI2IbyyAZJj8UOOoX7Fvl1qWAG1mwb5gtICTDqD9UN3X/uY4+BwZGr4PkzVeg TGTpWwNB28dpz0QJ0Nc2k6SY4uuJ84SEveRCIDF8UUeqoQtvVJuGL54cyGXBCm5Icy4S cte7NcgxRuoZiYaRpQ2gQuTz08ZHBYxkwujau2tmMvi+juUTqFuEVEiXbNlNd9W3LBN4 50q9Ip3eMWSPzFPPc8pYY4bmUI7P7O4KoA9DT6GGC8ejWJ+P7xz4irnO0WiWEu2oENM7 5ATA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=HOkQ7PsK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si6578514pgi.396.2019.03.11.21.40.46; Mon, 11 Mar 2019 21:41:01 -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; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=HOkQ7PsK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbfCLEjh (ORCPT + 99 others); Tue, 12 Mar 2019 00:39:37 -0400 Received: from a9-32.smtp-out.amazonses.com ([54.240.9.32]:40438 "EHLO a9-32.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726314AbfCLEjh (ORCPT ); Tue, 12 Mar 2019 00:39:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1552365576; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=1LTMJfj2MpOeyw9WxqSJjQTwp4yTHH300l9armbyJC4=; b=HOkQ7PsKGu3GSQcfBqMosDF+daAGkgtFYWtLnhM6U0lGK0XdYQ+blRTjybq852/P 0j3VXMrpX5d3eF+pwOtkhR78avcgymKf+t9Sz+WbQ0YmNes5jaMZRyZeX/jBxjICmh2 dnAFEAl8z0SmxzqaOBHIrVvRtJ9+MEc0ZqhJHsaU= Date: Tue, 12 Mar 2019 04:39:36 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Roman Gushchin cc: "Tobin C. Harding" , Andrew Morton , Pekka Enberg , Matthew Wilcox , Tycho Andersen , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC 04/15] slub: Enable Slab Movable Objects (SMO) In-Reply-To: <20190311224842.GC7915@tower.DHCP.thefacebook.com> Message-ID: <010001697032e074-f9658e7a-595f-4804-a7a0-fd4220ee8473-000000@email.amazonses.com> References: <20190308041426.16654-1-tobin@kernel.org> <20190308041426.16654-5-tobin@kernel.org> <20190311224842.GC7915@tower.DHCP.thefacebook.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.03.12-54.240.9.32 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Mar 2019, Roman Gushchin wrote: > > +static inline void *alloc_scratch(struct kmem_cache *s) > > +{ > > + unsigned int size = oo_objects(s->max); > > + > > + return kmalloc(size * sizeof(void *) + > > + BITS_TO_LONGS(size) * sizeof(unsigned long), > > + GFP_KERNEL); > > I wonder how big this allocation can be? > Given that the reason for migration is probably highly fragmented memory, > we probably don't want to have a high-order allocation here. So maybe > kvmalloc()? The smallest object size is 8 bytes which is one word which would be places in an order 0 page. So it comes out to about a page again. Larger allocation orders are possible if the slab pages itself can have larger orders of course. If you set the min_order to the huge page order then we can have similar sized orders for the allocation of the scratch space. However, that is not a problem since the allocations for the slab pages itself are also already of that same order.