From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 031622773F9 for ; Thu, 30 Apr 2026 18:47:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777574825; cv=none; b=mjqmSrKdxLaIpN31kCS60whG5bOZu8DdL92jTi+BBBS6nz5oZNHE9AI9czkdKBM4YpAqgnXf/nhHMI4K2TqjqkuYTbzzezYUdcK5BN9/0MoW2IAXATevhyFIcrcwpsyMY3XawwbaBUQAvAXJFOe+mVt7eYCA+ENRIicnJHA+Fws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777574825; c=relaxed/simple; bh=sgEmDrRG7CWGy0GhWu6kQhiMkkhNkXPK8olzYJNcb34=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tKzyrk1ubkt+Ib72eQ2Rd3wdoZN+mBOhT3BKhmemmIOB8j1w7nsu32eCkVE3TERX0DLHiu5RpbqhM4pGLDnjV93xA8wwz+F9DmxrYgpmuo6vjHwLIzaTrl5QJAzUUribgtE/ZBbyMIfYumqEwrQu19pHvcPGAv6d7Mpv474UBQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BOCQ5AjT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BOCQ5AjT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777574823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sgEmDrRG7CWGy0GhWu6kQhiMkkhNkXPK8olzYJNcb34=; b=BOCQ5AjTREiq8Ddgs+PkkXkkmycap5Ged0XAJ+FMvCLvxVdsQNwixdx/wbgt+Jx6VxXzZ/ XXZko1mIddkaPEL748JpL3mSMmANBX5ccUCSGu2YOEWfV5y74QERwhiqmFuYI5XOQKP+0e gL6vgR3ANRQGjNZnsGMZwU7C7N6kDFI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-567-yQvVCO7mO_iiuCeNpI7Y5Q-1; Thu, 30 Apr 2026 14:47:00 -0400 X-MC-Unique: yQvVCO7mO_iiuCeNpI7Y5Q-1 X-Mimecast-MFC-AGG-ID: yQvVCO7mO_iiuCeNpI7Y5Q_1777574815 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8785B195608F; Thu, 30 Apr 2026 18:46:54 +0000 (UTC) Received: from fedora (unknown [10.44.48.22]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 564FC19560A6; Thu, 30 Apr 2026 18:46:45 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 30 Apr 2026 20:46:53 +0200 (CEST) Date: Thu, 30 Apr 2026 20:46:43 +0200 From: Oleg Nesterov To: "David Hildenbrand (Arm)" Cc: "Daniel Walker (danielwa)" , "Darko Tominac -X (dtominac - GLOBALLOGIC INC at Cisco)" , Masami Hiramatsu , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Andrew Morton , "Liam R. Howlett" , Lorenzo Stoakes , Vlastimil Babka , Jann Horn , "xe-linux-external(mailer list)" , "linux-kernel@vger.kernel.org" , "linux-trace-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH] mm/madvise: preserve uprobe breakpoints across MADV_DONTNEED Message-ID: References: <20260429131522.4049054-1-dtominac@cisco.com> <889e4186-9f75-45d3-bd9a-1c90b218a635@kernel.org> <2d815203-a81e-40b4-92ba-31832c84c20b@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d815203-a81e-40b4-92ba-31832c84c20b@kernel.org> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 David, et al, I am sorry for the unnecessary spam but I can't resist... On 04/30, David Hildenbrand (Arm) wrote: > > On 4/30/26 11:16, Oleg Nesterov wrote: > > > > But may be MADV_DONTNEED should not set zap_details.even_cows == true > > by default ? > > It should. If you do mmap(MAP_PRIVATE, fd), and modify some pages, MADV_DONTNEED > must zap these pages. [... snip the correct explanation ...] Ah. Sorry for the confusion, I should not have said "by default". Of course you are right, and I understand this. At least I hope ;) Let me try to explain what I tried to say. First of all, I still agree with your "It shouldn't do that on a MAP_PRIVATE file-backed VMA". I also agree with Jann who suggests to make the manpage more clear about uprobes/bps. But, lets suppose that this "problem" is raised again, and we come to conclusion that it should be fixed/mitigated. ("we" actually meaning you and other mm experts ;) _In that case_. Instead of this patch (which, rightly or not, I personally dislike in any case), can't MADV_DONTNEED paths check MMF_HAS_UPROBES or vma_has_uprobes() to decide whether .even_cows should be true? At least when madvise_behavior.mm != current->mm ? Oleg.