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 X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F024C433EF for ; Tue, 7 Sep 2021 08:08:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB7C060C51 for ; Tue, 7 Sep 2021 08:08:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DB7C060C51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5F958900002; Tue, 7 Sep 2021 04:08:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A9EF6B0072; Tue, 7 Sep 2021 04:08:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4710D900002; Tue, 7 Sep 2021 04:08:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3428D6B0071 for ; Tue, 7 Sep 2021 04:08:39 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A1A4923107 for ; Tue, 7 Sep 2021 08:08:38 +0000 (UTC) X-FDA: 78560050716.38.CFCE9BD Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf08.hostedemail.com (Postfix) with ESMTP id 22A6C30000A8 for ; Tue, 7 Sep 2021 08:08:38 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 909FD1FD5A; Tue, 7 Sep 2021 08:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1631002116; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mE+UDLIcmL0uf5lAoyfAWlHoJhKxjw6dpsgL05G4NQ4=; b=mRAP/NrRrqQUFpSKeAZRgroS1r3RKbtLICl+LW39SeaHzKW6zlok4QP4NQpMGFPGbrfMV7 qq64m8/88ZNOYO1gmeozwQiya9J7c1cHbxY8ozubmJlDEdlCtOYiZUsqfm+HEtINK+52ld rRPr164T9YzuLxKjAVKElMFxVO3fZDs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1631002116; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mE+UDLIcmL0uf5lAoyfAWlHoJhKxjw6dpsgL05G4NQ4=; b=ETUZPolDOc4zCar0SL81Gt7AIAEQFwY5ixnV3j/PWRfRIoqJwO/TGrErzQA3fsBO9njq3x fhMXqhEWd+cqVLCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7772613C50; Tue, 7 Sep 2021 08:08:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CHaNHAQeN2HvTwAAMHmgww (envelope-from ); Tue, 07 Sep 2021 08:08:36 +0000 Message-ID: Date: Tue, 7 Sep 2021 10:08:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: [PATCH] mm/page_isolation: don't putback unisolated page Content-Language: en-US To: David Hildenbrand , Miaohe Lin , akpm@linux-foundation.org Cc: iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210904091839.20270-1-linmiaohe@huawei.com> <3b36529f-ab97-ddfe-0407-66f0cd1fd38d@redhat.com> <2d06db75-5c26-8fe2-6883-ac99056a9894@redhat.com> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="mRAP/NrR"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ETUZPolD; dmarc=none; spf=pass (imf08.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 22A6C30000A8 X-Stat-Signature: p8sx8cmaoau8cmuzx7nyzyxq3kuonwtf X-HE-Tag: 1631002118-736992 Content-Transfer-Encoding: quoted-printable 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 9/6/21 14:49, David Hildenbrand wrote: > On 06.09.21 14:45, Miaohe Lin wrote: >> On 2021/9/6 20:11, David Hildenbrand wrote: >>> On 06.09.21 14:02, David Hildenbrand wrote: >>>> On 04.09.21 11:18, Miaohe Lin wrote: >>>> >>>> Thanks! >>>> >>>> Reviewed-by: David Hildenbrand >>>> >>> >>> To make the confusion perfect (sorry) :D I tripple-checked: >>> >>> In unset_migratetype_isolate() we check that is_migrate_isolate_page(= page) holds, otherwise we return. >>> >>> We call __isolate_free_page() only for such pages. >>> >>> __isolate_free_page() won't perform watermark checks on is_migrate_is= olate(). >>> >>> Consequently, __isolate_free_page() should never fail when called fro= m unset_migratetype_isolate() >>> >>> If that's correct then we=C2=A0 could instead maybe add a VM_BUG_ON()= and a comment why this can't fail. >>> >>> >>> Makes sense or am I missing something? >> >> I think you're right. __isolate_free_page() should never fail when cal= led from unset_migratetype_isolate() >> as explained by you. But it might be too fragile to reply on the failu= re conditions of __isolate_free_page(). >> If that changes, VM_BUG_ON() here might trigger unexpectedly. Or am I = just over-worried as failure conditions >> of __isolate_free_page() can hardly change? >=20 > Maybe >=20 > isolated_page =3D !!__isolate_free_page(page, order); > /* > * Isolating a free page in an isolated pageblock is expected to alway= s > * work as watermarks don't apply here. > */ > VM_BUG_ON(isolated_page); >=20 >=20 > VM_BUG_ON() allows us to detect any issues when testing. Combined with=20 > the comment it tells everybody messing with __isolate_free_page() what=20 > we expect in this function. >=20 > In production system, we would handle it gracefully. If this can be handled gracefully, then I'd rather go with VM_WARN_ON. Maybe even WARN_ON_ONCE?