Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4140178imm; Tue, 29 May 2018 23:12:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLrR7iG9lK2FCqaS99it6qFypRad3I82J+0YrqESijVaxbjPkjjL7ZTqXFUCdYterAEj3M2 X-Received: by 2002:a63:343:: with SMTP id 64-v6mr1178340pgd.354.1527660774403; Tue, 29 May 2018 23:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527660774; cv=none; d=google.com; s=arc-20160816; b=uE1v3ueTT6tM/kpwa84IOG/3Zy/YGrIuasqyyU8S7iP01KHIskvfUP0E9BRaFux9HM OF+Rg5yWblQdT9P3DmLvnZKPuw7EL8OCyD4Q1ZQOcgAEiNRV1KQ/vP4lXd/A10XpFIPh egAjP5HA/k7RBdyeatsK20OihD6KDbRuY5VLfwze3MjxOFNvnqlCq/LuDDSJBRf7kuyY imhTjISFcsCtEIQOiYyAhhf+OkOm6m+0vjAbu1v1mf53zDVZF1RtKzzisVPirojEHqjj OgvKw5OjEP3NwU3hfanuqwUZmJ3PKta009xoDGUDg+arRibdU4sMI/2+hQi5Fj+DSDZd pEIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature :arc-authentication-results; bh=Zf12DbuOHY3vt2IlGl3mCnH+9E28bjz84jR8waaRPf4=; b=caHTIaU9n9pkVk/+uF3ogwEoIXq42raB/7q4QxRaR0CtoTPrYah/k+Asr5FIeZcra5 3nQQqBvV4pBp2IUYqACAS5NpxGLqin1NcIjA+40i4s3h5qy0tTEhi0uC81Oo9OtZ5ipt HnK/uaOq6DxxMm13FtIJFB3PrPWC8wQ5KGCvllaajewa26/mljP2LlVRLhk6+f0Tar1K 4uTNiLbeu48az8qfYUpljNRfzD7eYCBHJkS7THXGRuLc0KwLCU8TSKPhjPc4OzLprAL0 +35UctyXjJEla0ignpOy3Xok5MagrKsQyx7pBAYqi/gQQC2tC9+JNgAGEVNsHqo/9dU0 M4Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qWkGCnMd; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u123-v6si4518858pfc.178.2018.05.29.23.12.40; Tue, 29 May 2018 23:12:54 -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=@google.com header.s=20161025 header.b=qWkGCnMd; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935672AbeE3GMM (ORCPT + 99 others); Wed, 30 May 2018 02:12:12 -0400 Received: from mail-qt0-f201.google.com ([209.85.216.201]:32816 "EHLO mail-qt0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbeE3GMK (ORCPT ); Wed, 30 May 2018 02:12:10 -0400 Received: by mail-qt0-f201.google.com with SMTP id t2-v6so8474164qto.0 for ; Tue, 29 May 2018 23:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Zf12DbuOHY3vt2IlGl3mCnH+9E28bjz84jR8waaRPf4=; b=qWkGCnMdhgBVD9EFQ81M7d63i+zvknWKFKM60djFO2+D7KdW9bw7dt7sYMZwfHQlLx cLYjtpnjkJeRzobNEaUKhH25tdWo4H99hUFXnzxqjYJ8seiHQ9r9y/KEnUc6UfNtrbjg I5dCTBGL0oEpkRHVGWNfycU1mP3gQxcajSASWDdbxc/xlpMb8wYgbgS+jAHEEE7I8FIg HtpTLQ46pwuur5EmOGcCCbELWirIs1ChwLy1S+LZWpHZk1Uf2M8RbdMIFWpdWFPfLF9b 7b8Enab/LJYLykMEt24orLH0ySyQOPB0dYOAcBi+pLbQIPUdX6bLuEJRsySwpMEm5HeN gSAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Zf12DbuOHY3vt2IlGl3mCnH+9E28bjz84jR8waaRPf4=; b=bXrjYY6/zK7/abRA9DwOqCzZUppYuvZiFZ43N3q3VY/j9JzADbTIRRpEv/oRG1tcRI tNjthqoRpY0tLLMe0N+eSBN+oV6cE2jFekUZVkb7wN4WSr2pvjbZ7hVPTtcfzTmo9DqX v44dwp4LBNwE/xcspCp2k84WzMg/nEFbNxY4syFILmlxN+890owB95xB0ZK92mY1+FVy mrRIumt6RDJMhoQQvFdSAItelZ9Bn8rV2xg005QziYwi8kXNbm1YT+3fNfa9/ndP2fjN rQa4I3AoMyrhbmf9+AjRjbgoY5+v6IxNJjdecGEtVCU2OpvV0iXkpGdVTM1acw7W4P6E ytXg== X-Gm-Message-State: APt69E2K7wCGIhEzymNrnqcDtJYFjU8Jtmg4bI8ht4bmEQ7OH0tdSvUG pcmrjan+111RyvyofYUp9BP8GmyJ8xA9 X-Received: by 2002:aed:3984:: with SMTP id m4-v6mr737868qte.20.1527660729853; Tue, 29 May 2018 23:12:09 -0700 (PDT) Date: Tue, 29 May 2018 23:12:07 -0700 In-Reply-To: <20180529025722.GA25784@bombadil.infradead.org> Message-Id: Mime-Version: 1.0 References: <20180529024025.58353-1-gthelen@google.com> <20180529025722.GA25784@bombadil.infradead.org> Subject: Re: [PATCH] mm: convert scan_control.priority int => byte From: Greg Thelen To: Matthew Wilcox Cc: Andrew Morton , Michal Hocko , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthew Wilcox wrote: > On Mon, May 28, 2018 at 07:40:25PM -0700, Greg Thelen wrote: >> Reclaim priorities range from 0..12(DEF_PRIORITY). >> scan_control.priority is a 4 byte int, which is overkill. >> >> Since commit 6538b8ea886e ("x86_64: expand kernel stack to 16K") x86_64 >> stack overflows are not an issue. But it's inefficient to use 4 bytes >> for priority. > > If you're looking to shave a few more bytes, allocation order can fit > in a u8 too (can't be more than 6 bits, and realistically won't be more > than 4 bits). reclaim_idx likewise will fit in a u8, and actually won't > be more than 3 bits. Nod. Good tip. Included in ("[PATCH v2] mm: condense scan_control"). > I am sceptical that nr_to_reclaim should really be an unsigned long; I > don't think we should be trying to free 4 billion pages in a single call. > nr_scanned might be over 4 billion (!) but nr_reclaimed can probably > shrink to unsigned int along with nr_to_reclaim. Agreed. For patch simplicity, I'll pass on this for now.