From patchwork Thu May 24 23:00:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 10425677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BE3276053B for ; Thu, 24 May 2018 23:00:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFA1229548 for ; Thu, 24 May 2018 23:00:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3226295ED; Thu, 24 May 2018 23:00:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DD06295C2 for ; Thu, 24 May 2018 23:00:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE7506B0275; Thu, 24 May 2018 19:00:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D96736B0276; Thu, 24 May 2018 19:00:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CAD4B6B0277; Thu, 24 May 2018 19:00:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f69.google.com (mail-pl0-f69.google.com [209.85.160.69]) by kanga.kvack.org (Postfix) with ESMTP id 8A70A6B0275 for ; Thu, 24 May 2018 19:00:36 -0400 (EDT) Received: by mail-pl0-f69.google.com with SMTP id bd7-v6so1826135plb.20 for ; Thu, 24 May 2018 16:00:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:from:to:cc:subject :message-id:user-agent:mime-version; bh=o1ewnNDo76bNQ/THCxR1DN5RvjqiolxIma8INjDqJWE=; b=pgySD0R0BLdwhzvYczA871kOaNSR8ZflhZINu8dtgW4sEVYaQi7/Qg2gRqNaHw3+in q+Wb9qZUxtuXu15liZVJ0BKY/yqjLF9OnEQFOonLHcKcmm8EhCz0olsic713mxtTMKNP 3v6IwjlmjLV4uPekG+BU6/i+nK9Qs2Cpvrn8KFZd3euIMnIyPRKJd6i3TarbMda2iF7O LmNM+g+ETVzFuHlR9qHKsRwiHoQ6wmLPhhpbcCjojd8CsB2UqzQ6L9ozyjInAY5fs2rU MEPurFMpO4Q36cHK9bM5CKiti3eprUFHJAWBK5yGvpfGeuz3JqpIbuqUetHGgjEkaYgQ Klyg== X-Gm-Message-State: ALKqPwd8FOJSoZpVvF3AUMNcKAIBr84h+Yc4x+M9mf4svyH+ltgNHBCL CzLIVkInBF/qKMxcqugD5QGvTR5J+Xj011WxJziyx9TS/WAsY00qcjHUJai7/g2QVOVeXr/gGxP sspXzbRxpUC2DOhv1ZCx0OFTg7MP3+tN90uhBgDszM11PGCdV9K1bB1b8lIjrRCY+DgpP9MX3CZ My1Ktq5Bil6jzG5HW/TlEHEc30ujomDIZEk6zGPFj82kto68oKyHydeJK4po0aPKfVMEvXmtOLH EPdVNCGi1pNMg221O38IesDYWTQCEEvkmBZ/l5M3mbbQ2l8NEaxkwcLAiY1DqMKacXvi4EzLxvs WGLNMj43qAyLxGD0WfoU6zjLENiKXNUg4QXAl+jihsdCkni2lwVSv7iFF3Ae3+kee8URpXkqhZK 6 X-Received: by 2002:a62:4f0c:: with SMTP id d12-v6mr9160968pfb.220.1527202836237; Thu, 24 May 2018 16:00:36 -0700 (PDT) X-Received: by 2002:a62:4f0c:: with SMTP id d12-v6mr9160912pfb.220.1527202835481; Thu, 24 May 2018 16:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527202835; cv=none; d=google.com; s=arc-20160816; b=jE05AzGM+7CLaz3q5nMx67pqNjRfIhPeBUWkb3gq2jU2XA/GHdQosdw77gEet6GZTb NEAGce4d3gQYlY4c2W8IaSVcZiJjRtRb79Y4a/sNIRsIF3E/AKBIpyLPAxXUvGVf8WbK q7kk9gotPLZOXAxZiqOP26hEjHVw4gYxh4dphAZKvqwYKiJu1gxAUUrsdhkIW2q1ZO9J 7LxwE8dMZp+X0coVzjyOpwt2cRG16J+0EUWnsHLsvaCkv5qYFmWUtAdvWVm9AZDL08Kg 4/Urm8hdVODitetLU+tnwHpwsz4dd3mqVd1f797QbgFcwnFF8QFc2vBH/e4yle3+F4QM cK1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=o1ewnNDo76bNQ/THCxR1DN5RvjqiolxIma8INjDqJWE=; b=A441cDYMGK1mlZByTcMxqH8y7lGEtcem6W75ehv/BKqzmKPhDa3yPUKiPnrHW40M2u zDMhmfpCWkftFLMt3W1tspUqSLpEXgTj84Sg3qHIbbaIUbQCC1TSx+aDR6AxmVRMjpAa 5cHHBDHplR0KISdT5YZmjqtaS3eNBVSMpBclDWiuOAYIxPB1hNDNn92hoHHfprqatj4j YLzuthZ+j9snmHPtAZRzuI7gSyk0vo51O4p5cf93HUVyCnTahiHAFyAL0RFtg195x/XI kvovT9jcuU1cEdGGswENB0WWRSQdhltqstR6Wi83OAt408sgs3SEn47cePsovQgklmm5 SATQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o3XwDNcK; spf=pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id r39-v6sor10343706pld.66.2018.05.24.16.00.35 for (Google Transport Security); Thu, 24 May 2018 16:00:35 -0700 (PDT) Received-SPF: pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o3XwDNcK; spf=pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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-Smtp-Source: AB8JxZoRZpJjZHxxgaCHrvD7w7VrtXxyzmJieWZPIn4vHRiYIMS7x5np1PfMro/hUeo6HEcE2T+tEg== 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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;