From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A269FC433F5 for ; Fri, 7 Jan 2022 19:51:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C63FE6B0071; Fri, 7 Jan 2022 14:51:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C139D6B0072; Fri, 7 Jan 2022 14:51:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB6336B0074; Fri, 7 Jan 2022 14:51:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 9BF566B0071 for ; Fri, 7 Jan 2022 14:51:52 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5E90982C27FA for ; Fri, 7 Jan 2022 19:51:52 +0000 (UTC) X-FDA: 79004536464.04.14039B9 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by imf11.hostedemail.com (Postfix) with ESMTP id EFDFB40003 for ; Fri, 7 Jan 2022 19:51:51 +0000 (UTC) Received: by mail-lf1-f47.google.com with SMTP id u13so19226128lff.12 for ; Fri, 07 Jan 2022 11:51:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZDmCDAiYhTVuYUfs3SOTkjNWRZtD7CTjS5SbmPGZLuU=; b=jfH0M6K4Vh7EewiEUOo5i+vjV7MPS0tINGb/bOkKWbyLMZ2XWFQnkth82BBRSkuPYf KwSzZLVJeSakNWMcia+1csd3c4jDsc7BiXZ1b2AxdymDdeLtVXpjOlk/Lt6P1sFilDGu RkZScypj4+pqPKYt4duZs6YEg/y/TA1ODq35CzT7FsqXlgJEEeAehT7Qy/I2JjMGdmi5 ryJPORcn8Tds6/QJ1TtJS8y26M91PtGBTpMQutqqF56/cOa7VOWj49h43XRonhwmL49y eVhu4egh5V3NvZ8csGhkdvNKnqgtQkeIR1OAet6Fq5VnLOX0ad17pGDDEE16bNcIgdCk W+HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZDmCDAiYhTVuYUfs3SOTkjNWRZtD7CTjS5SbmPGZLuU=; b=Xce6JQjoKfwgfrVwol9x/163tfT7O/lVohr6SXXD3kpcXPt5OI+LME3O/0Cv+qlrZt EXntnckbYcBHI6xu9WCUIqdCu6aHI7KWFjnMMzEPlwyF3AqTWdyDhCorv6HNPSFYuw4V 9f6Tsa09hGaREL4HBCN5zE8aCq/w+dX7IIlp/JmjFdswSKXgM8HahBLVywXjeyyeex4X ZxsgLYRtO77gmYorjBpQPnCQK1dc723siJ6zh+QMz4sChsHlcY/Q7r09ikhnBm6GEVBG 2m1CE5tV1nLLGBZobfKOPK8MR9b11LPYIYt5ZXnAWJSe4E0f76AEWD+SlGybVwmYU67j Oc9Q== X-Gm-Message-State: AOAM531Hd9qZMe/LtiHvKUTTyVPml59FK4hP7Skb6ozH8PJR7SbGz6Ey np+oyy9jAzXDcc5heTlK1Rs= X-Google-Smtp-Source: ABdhPJwwMBBRiteixwLwk6cfyZIZFQaMZnHzN5OvYQcGYjuT+m9aW6r1U2r+vhKGfeVf2vWhZ3i4PQ== X-Received: by 2002:a05:651c:201c:: with SMTP id s28mr51124851ljo.316.1641585110323; Fri, 07 Jan 2022 11:51:50 -0800 (PST) Received: from grain.localdomain ([5.18.251.97]) by smtp.gmail.com with ESMTPSA id y20sm691745lfa.131.2022.01.07.11.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 11:51:49 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 71C895A0020; Fri, 7 Jan 2022 22:51:48 +0300 (MSK) Date: Fri, 7 Jan 2022 22:51:48 +0300 From: Cyrill Gorcunov To: Christian Brauner Cc: Pintu Agarwal , Pintu Kumar , open list , Andrew Morton , linux-mm , ebiederm@xmission.com, sfr@canb.auug.org.au, legion@kernel.org, sashal@kernel.org, chris.hyser@oracle.com, ccross@google.com, pcc@google.com, dave@stgolabs.net, caoxiaofeng@yulong.com, david@redhat.com Subject: Re: [PATCH] sysinfo: include availram field in sysinfo struct Message-ID: References: <1641483250-18839-1-git-send-email-quic_pintu@quicinc.com> <20220107120451.z2eqru2tm5mlhla3@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220107120451.z2eqru2tm5mlhla3@wittgenstein> User-Agent: Mutt/2.0.7 (2021-05-04) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jfH0M6K4; spf=pass (imf11.hostedemail.com: domain of gorcunov@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=gorcunov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: EFDFB40003 X-Stat-Signature: mzwu1cx4ozywtgupyw5qeom4bmcrgizp X-HE-Tag: 1641585111-471762 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: On Fri, Jan 07, 2022 at 01:04:51PM +0100, Christian Brauner wrote: > > > > Wait. The userspace may pass old structure here, and in result we > > return incorrect layout which won't match old one, no? Old binary > > code has no clue about this header update. > > Yes, that won't work as done. > Yup. When I've been developing struct prctl_mm_map I reserved PR_SET_MM_MAP_SIZE opcode so userspace would be able to query current structure size and provide memory slab needed to fit running structure. As far as I see we can cut off some space from padding (at the end of the structure) though one need to make a precise check that there is no alignment holes appear on different architectures other than x86. This area is pretty sensitive.