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 B0AA4C7EE30 for ; Thu, 29 Aug 2024 07:19:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4BD2E6B00C4; Thu, 29 Aug 2024 03:19:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4936C6B00C6; Thu, 29 Aug 2024 03:19:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35A246B00C8; Thu, 29 Aug 2024 03:19:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E98CE6B00C4 for ; Thu, 29 Aug 2024 03:19:18 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B100BA041A for ; Thu, 29 Aug 2024 07:19:18 +0000 (UTC) X-FDA: 82504431996.07.F917B30 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf15.hostedemail.com (Postfix) with ESMTP id BB683A001A for ; Thu, 29 Aug 2024 07:19:16 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=BMDXZgp3; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf15.hostedemail.com: domain of mhocko@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724915884; a=rsa-sha256; cv=none; b=EqoqAJo+7bz6ONAXFaEsLohCn1/FxtpJ7MJ7MJlPVl94wtX2YFW8dO1cKsDHOVGDIuZPUj ot6j02i+YjZMOpgSB3eSz1CotBymEYP6DoEdCYH9AepTDBTR1tCo6I61Lk6EUGn65yBLi3 zFCQM+fOi6qAI2FmTx3TXR3MTwn7tRg= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=BMDXZgp3; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf15.hostedemail.com: domain of mhocko@suse.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724915884; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cZZ5Dfz1N7noCUMuVJV0Kdu8cyfE+FvZY+c2JPzrzUQ=; b=vMVf0UBOu03Y5YfJ/W/5w+Uk4HKvLuc/vu0qpkPl7ZFUUeW+9tJgobx838J2x4xip3aoQr d087GZ6cFQQZMenWFNMppIZoIgZMU9nBol8qmkzGb7g9Naunzy2/JP/wa/2f9+l6CgAw/h As6cZYqFa/UK0Cj0hWCzXJZqAEZHjXc= Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42816ca797fso2796205e9.2 for ; Thu, 29 Aug 2024 00:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724915955; x=1725520755; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cZZ5Dfz1N7noCUMuVJV0Kdu8cyfE+FvZY+c2JPzrzUQ=; b=BMDXZgp3FGNCqTexsx9QOmg/YhaRf+CJ4lKE2n8rECTtymItdGVEg+o6FOScllduKj /0Vm8HRimVLegAEyjQnmeIbOVhnhpxzUCwGZNLBvRDBTCHlkUdkGGgrfWO5Awfr6oy5N C2pzRlKBNRw2t4UVl3OD6JGoxvZSE2RrqH8k5SGTflVy6cBtpf1xUWHByjVgsuyyQBAu itm8p0zlvY9atHXlXEm7f1Lc1Ql76Gh0car4Rtb1tFO7kaRPn8QkPsghGRKahd+fr6gT Ow2hR0zJKI0jJDOXOvpc2HKNZs9KwDCds/mlfqnaUXhy49wV+9MCiCKG/JuCa/K2Jslc Z0hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724915955; x=1725520755; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cZZ5Dfz1N7noCUMuVJV0Kdu8cyfE+FvZY+c2JPzrzUQ=; b=tSoIy/RBCInb+1XInOHbdDqkupDZjP3b6ydL/+IBLqrakCUUoXOjPZ3xvdcVhBS+nk wYlYydicUcheuOOVE3cHIKLAXaFZQczIPiAdH8ke/nf2M6FWPjHMMdI6tvjmMrA/DHGX LpnJDR4id6SjtDpXsqc2u1eKp+mIcCasX/mftYkH7w41DIpbjKpG7Oj+U3TRIr/uhD0g 6xSQpF45C67LSf5D5UyrmJF1EgEOxR5+S6NKzOG6JZl2d2X5d4CU8SZoRUAjIMMYH0I8 aKKR6LThkaGFss3XZ/rkhMuQSsnnCrCL1DuaC/IQDYqEyYN6u/6LXqcHyE09iQc06tjg qMnQ== X-Forwarded-Encrypted: i=1; AJvYcCWsUx1uGkyNIm9deNFGe7CaVpcjYg+6uxEbZseEhh2hSONMj2H0NdSVEJrrjEhM+sumu62dbbApyw==@kvack.org X-Gm-Message-State: AOJu0YzcgNFyqOjOP6PVKamYoyrS1GGe15QKCTwgYLMKB3bB5G3w3WI0 ky7TSJUKCqBonLRfs4EybZ83MuwSwoTJWV8Ou0bpL4prXaHGg7RifH8vWbVaTDk= X-Google-Smtp-Source: AGHT+IGWX48blvuHIVWdw3Bdns41uj8z9ckLX+g7N99SFM42wMeFHQFkVqKqWrh8ih/Ez3xgeQ7kyg== X-Received: by 2002:adf:b312:0:b0:371:82bc:7d93 with SMTP id ffacd0b85a97d-3749b526ec0mr1284850f8f.12.1724915955164; Thu, 29 Aug 2024 00:19:15 -0700 (PDT) Received: from localhost (109-81-82-19.rct.o2.cz. [109.81.82.19]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ee9ba83sm665280f8f.54.2024.08.29.00.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 00:19:14 -0700 (PDT) Date: Thu, 29 Aug 2024 09:19:13 +0200 From: Michal Hocko To: Kent Overstreet Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Chinner Subject: Re: [PATCH] bcachefs: Switch to memalloc_flags_do() for vmalloc allocations Message-ID: References: <20240828140638.3204253-1-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: BB683A001A X-Stat-Signature: 3tqa6o3md13xonkbg9ypofm59shyn4hx X-Rspam-User: X-HE-Tag: 1724915956-279720 X-HE-Meta: U2FsdGVkX1/qo1SIIiRDGjNeWQl5NJ5Mp/MJkmRywtUZEOtaWhH54nBoSu8hOPTZ7Vj7vy4XB99M4BK5TpXld4NMy/uF+JTL2A2LVsEgP+HMZ6SMlulPJATsIVi8bcpQHJSaaUXiCcAs838PfWysbtJ/+N+McYMgveP0w3T0DkwpUUbWAywJ76YO5QyLZlfM8T95ugrwN9WaxzE3//tdOdKjr7Gh0mbxPVdZh+GAuwQJ1pEXahD3UrHH13goIOQuqUzuaPI+eI6F8EDa8SpZZqpniOb/FpVCsc3ecHY6t00cPZW4YxWhR14+1Y5N6h4KLf/55kR31nbICbplWbJgFz2XdKrXHlGSlh774x/rhRyqqoOiABHH1VqwCLsb0dM+UZUzWG1DppbegBwqDtcgRkPImMksEF3aAO5BLobBjtVQWpcaYc/pNj8OsXj51H+k8GvDsCjIZoCivXlsP++xT7ltp+Gzed3eVyZqZUGq0h72CbUp8jxZcTPVUTb0MTh5icoesY4MJutQ7gULc60Ug8MJQhGD7IYfBe9i3w2NrdC9TvQ3Tpb1gKlR1L5Vpip0BKSwLgMN1Iwk1SoT0WTItHgfzFY6Ev82R+tTSBxf3+eocCXlAoa2CIG9LvdPZaDlFSiklwKA4itN1yJzV/ekTC7nsqBVHUgHgU+6Tk7ECjQNjkC9ls8aXS1M+ebKVonKjyXFbTB5x+aY2cPgmzK61S1RJ5NIQfT2ThQQ14VsWtE2z/vxkQLn/iwAnh544RhhgF/sUPjZSFknoani3fHYlaihl3U28QGcxiKW/67xOktdbsJPZL27miYITYIeArsO8BbrQI3z0vXXBLs9KMtYyulyeEZQMF72JO/K/PgUFR6FlKA7akJ9R5HZotQ/e8RkHzEQggi0z5WdzhYXgzE8+dgIfQai/9F3mvoSWp33g7QIOUymbysIx37AndpMwgr3cRTFpvrjImDKE4sPygJ WX9Qy3+Q lJA/K30Fi79B+fUSEhRm9laiTptU09fy0YjUaESAYHb42rJdw0b5tougd4m9YBxwiqqY5PFADs/AnMl+HLyL70CYlFnRCMocuQuLTul9Nh5g97RQjHs8TV7KCDhlcN2W6bajEJi6BWDHgxtrwAI/7ltPr3q5etXheNOg42bX6No43ERQgSj2D30zNNu+JWiQfT3mP+jPTeaA6LcGHMEwxFjuUzqV58KIAOSSRhQWsRglhUskRjmlm+hRKn6CURfK7eGfoMVH6oYyA+IZOe2d0SddyUXUvO71CKYpZSNthNhm/a88Mk8/0FxTfeaNkB18HHlBBAY8eFTjLu3qCki2+j4rupedsjSp4ml/s 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: List-Subscribe: List-Unsubscribe: On Wed 28-08-24 18:58:43, Kent Overstreet wrote: > On Wed, Aug 28, 2024 at 09:26:44PM GMT, Michal Hocko wrote: > > On Wed 28-08-24 15:11:19, Kent Overstreet wrote: > > > On Wed, Aug 28, 2024 at 07:48:43PM GMT, Matthew Wilcox wrote: > > > > On Wed, Aug 28, 2024 at 10:06:36AM -0400, Kent Overstreet wrote: > > > > > vmalloc doesn't correctly respect gfp flags - gfp flags aren't used for > > > > > pte allocation, so doing vmalloc/kvmalloc allocations with reclaim > > > > > unsafe locks is a potential deadlock. > > > > > > > > Kent, the approach you've taken with this was NACKed. You merged it > > > > anyway (!). Now you're spreading this crap further, presumably in an effort > > > > to make it harder to remove. > > > > > > Excuse me? This is fixing a real issue which has been known for years. > > > > If you mean a lack of GFP_NOWAIT support in vmalloc then this is not a > > bug but a lack of feature. vmalloc has never promissed to support this > > allocation mode and a scoped gfp flag will not magically make it work > > because there is a sleeping lock involved in an allocation path in some > > cases. > > > > If you really need this feature to be added then you should clearly > > describe your usecase and listen to people who are familiar with the > > vmalloc internals rather than heavily pushing your direction which > > doesn't work anyway. > > Michal, I'm plenty familiar with the vmalloc internals. Given that you > didn't even seem to be aware of how it doesn't respect gfp flags, you > seem to be the person who hasn't been up to speed in this discussion. GFP_NOWAIT is explicitly documented as unsupported (__vmalloc_node_range_noprof). vmalloc internals are using vmap_purge_lock and blocking notifiers (vmap_notify_list) in rare cases so PF_MEMALLOC_NORECLAIM is not really sufficient to provide NOWAIT semantic (this is really not just about page tables allocations). There might be other places that require blocking - I do not claim to be an expert on the vmalloc allocator. Just my 2 cents do whatever you want with this information. It seems that this discussion is not going to be really productive so I will leave you here. If you reconsider and realize that a productive discussion realy requires also listening and respect then get back and we can try again. Good luck! -- Michal Hocko SUSE Labs