Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2953015imm; Thu, 24 May 2018 19:47:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+qJBMQy/JAxA08Q6s22U5FOd6GMZTsQwZuIMzHYOEPDEsJkZENbwU6pjS0+Vb/vlq4GNM X-Received: by 2002:a63:a042:: with SMTP id u2-v6mr468299pgn.413.1527216455493; Thu, 24 May 2018 19:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216455; cv=none; d=google.com; s=arc-20160816; b=b+72j3NcdmFVsSe1zyLmgBzDH7kMXHlZhIzOlPuwTXEvhqqmf5pV4QnEbHqpLvQhQF aIsnmM8WYpPpxn2++NvXyJirCN2gKzzXUyGzpX8lDzaVnopxNKPqjMN7t4v5JFgD1aZW DCT7O1y717nj+/urPgcoHvWeGmKOdKYbdyf3E3s8xchVYijOVVz8rGZSJAT16S0oce7V /UwKxZO3Fk3EyDfrT93iVCoWswCJaXYXeAoWP0D+dwoYY3jgpSIy1nWWuv01OIAQtW5T HpxWq1w8mn10MrEnZ1PoZDpCLhr+ulHX50eJF3pztK9rRNeE/hqDTV38XDAuqDlTtjaq jyWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dkim-signature:arc-authentication-results; bh=o1ewnNDo76bNQ/THCxR1DN5RvjqiolxIma8INjDqJWE=; b=MtDXK01LqJqgGk2ROzmNQO0qZWUd8CeL5Lx4TfqDLaKFl/IY0flmfMLaskRy/JghLv /MUVCjL2PB/gjTksYisHPrcTb7DDtV+dd68QQ1negh/LiioBPTlrBfW1FE2oGoMUXVDy NwbsRGlo8sa4rlQrxfLy06cpOo+q4/wvlXqDYmmuBKBX4bFKlNUI86I/Nbmf2TRc3Jrc GczcLckNpKainyKR4qcl8P2FJimgOndm8bLKubc6bgDV9uN2VsNhWAH8U7gkeS+AAT/i AmHqvJT0+zOT4vrKM7wdkou+gJBSc21EqaJmpCJIuydWyx8zO49ZiEe7slpJyoN7y45M LA0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o3XwDNcK; 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 u191-v6si2293089pgd.667.2018.05.24.19.47.20; Thu, 24 May 2018 19:47:35 -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=o3XwDNcK; 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 S964917AbeEXXAg (ORCPT + 99 others); Thu, 24 May 2018 19:00:36 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:34174 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935346AbeEXXAf (ORCPT ); Thu, 24 May 2018 19:00:35 -0400 Received: by mail-pl0-f67.google.com with SMTP id ay10-v6so1942364plb.1 for ; Thu, 24 May 2018 16:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=o1ewnNDo76bNQ/THCxR1DN5RvjqiolxIma8INjDqJWE=; b=o3XwDNcKkXQFdbXjmTrXyFhGwC1Kw/9DgBwkkhMQmsKQ6XaTlS33mMELFuRlmtlOK3 dC8WcGt6fDlekE4zVjWAfK7quonqF9fY7UkhMp3zDxb5Ebo/bLhZqKgli9apLJ68N2Bi PyzrmaoWp4xe9fwKjt/y0XFklDJJRuOfqQ1znYCu5CAFv51YTFivHCGezuE70ectyNcz n5CtyKAQw0wepxCbflUpL0gJlW+dkagbeBypEvBJs5EYveBDgRUTQN6o/TiM9Dp4DSOF OGor+/5vgg9ct+1T3zSJVkYYvQPMReO8vhI0DLgannukpaW6IGwWN8MjzfTH+G/PA/Pa BR5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=o1ewnNDo76bNQ/THCxR1DN5RvjqiolxIma8INjDqJWE=; b=ipPdpY0/mkestVDjUCf4qv/y8kzBTqgmTkYQ7JWCo4Mz9nsPG8WB6VSfMQI/2Z/QNt RAzw0Hg+A3vF1pLx+RWn87L5MNudOVupo3mkuFe565JVjw0Gs10gtTaMrbO0VbOsDzZ6 MBvsbkuRmor+DP9cLYH5gRih35uMgnZSyqPLM4paFR3FrYj5m3x/6llnwFpYafOTrhyI cPkf3R0cUQXlwW6LzA5V9cCDI7tKmElleSuh4P8giZP11C2oIeBqoFdVbriwhBDlVO1J D7a82KwOq/UK7ZgSSzlvZAnNzkLRNo77efIObRpJACbqjEJ/JFS7PfuYdh8uoye2KqZa gzdw== X-Gm-Message-State: ALKqPwfd/34PLnbFpbFTZZUW8ggFwtycbJLEmk8KaxVrXPY07axRF9US Fv73ISIKajALQT+cDwYabqO/oQ== X-Received: by 2002:a17:902:40d:: with SMTP id 13-v6mr9295413ple.117.1527202834516; Thu, 24 May 2018 16:00:34 -0700 (PDT) Received: from [100.112.82.131] ([104.133.8.99]) by smtp.gmail.com with ESMTPSA id u5-v6sm16111399pgc.45.2018.05.24.16.00.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 May 2018 16:00:33 -0700 (PDT) Date: Thu, 24 May 2018 16:00:23 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: Andrei Vagin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] proc: fix smaps and meminfo alignment Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 4.17-rc /proc/meminfo and /proc//smaps look ugly: single-digit numbers (commonly 0) are misaligned. Remove seq_put_decimal_ull_width()'s leftover optimization for single digits: it's wrong now that num_to_str() takes care of the width. Fixes: d1be35cb6f96 ("proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps") Signed-off-by: Hugh Dickins --- fs/seq_file.c | 5 ----- 1 file changed, 5 deletions(-) --- 4.17-rc6/fs/seq_file.c 2018-04-15 21:45:06.740885410 -0700 +++ linux/fs/seq_file.c 2018-05-24 14:41:21.508491794 -0700 @@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct se if (m->count + width >= m->size) goto overflow; - if (num < 10) { - m->buf[m->count++] = num + '0'; - return; - } - len = num_to_str(m->buf + m->count, m->size - m->count, num, width); if (!len) goto overflow;